class DynamoAttributeValue
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.StepFunctions.Tasks.DynamoAttributeValue |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctionstasks#DynamoAttributeValue |
Java | software.amazon.awscdk.services.stepfunctions.tasks.DynamoAttributeValue |
Python | aws_cdk.aws_stepfunctions_tasks.DynamoAttributeValue |
TypeScript (source) | aws-cdk-lib » aws_stepfunctions_tasks » DynamoAttributeValue |
Represents the data for an attribute.
Each attribute value is described as a name-value pair. The name is the data type, and the value is the data itself.
Example
declare const myTable: dynamodb.Table;
new tasks.DynamoDeleteItem(this, 'DeleteItem', {
key: { MessageId: tasks.DynamoAttributeValue.fromString('message-007') },
table: myTable,
resultPath: sfn.JsonPath.DISCARD,
});
Properties
Name | Type | Description |
---|---|---|
attribute | any | Represents the data for the attribute. |
attributeValue
Type:
any
Represents the data for the attribute.
Data can be i.e. "S": "Hello"
Methods
Name | Description |
---|---|
to | Returns the DynamoDB attribute value. |
static boolean | Sets an attribute of type Boolean from state input through Json path. |
static from | Sets an attribute of type Binary. |
static from | Sets an attribute of type Binary Set. |
static from | Sets an attribute of type Boolean. |
static from | Sets an attribute of type List. |
static from | Sets an attribute of type Map. |
static from | Sets an attribute of type Null. |
static from | Sets a literal number. |
static from | Sets an attribute of type Number Set. |
static from | Sets an attribute of type String. |
static from | Sets an attribute of type String Set. |
static list | Sets an attribute of type List. |
static map | Sets an attribute of type Map. |
static number | Sets an attribute of type Number. |
static number | Sets an attribute of type Number Set. |
Object()
topublic toObject(): any
Returns
any
Returns the DynamoDB attribute value.
FromJsonPath(value)
static booleanpublic static booleanFromJsonPath(value: string): DynamoAttributeValue
Parameters
- value
string
— Json path that specifies state input to be used.
Returns
Sets an attribute of type Boolean from state input through Json path.
For example: "BOOL": true
Binary(value)
static frompublic static fromBinary(value: string): DynamoAttributeValue
Parameters
- value
string
— base-64 encoded string.
Returns
Sets an attribute of type Binary.
For example: "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
BinarySet(value)
static frompublic static fromBinarySet(value: string[]): DynamoAttributeValue
Parameters
- value
string[]
Returns
Sets an attribute of type Binary Set.
For example: "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
Boolean(value)
static frompublic static fromBoolean(value: boolean): DynamoAttributeValue
Parameters
- value
boolean
Returns
Sets an attribute of type Boolean.
For example: "BOOL": true
List(value)
static frompublic static fromList(value: DynamoAttributeValue[]): DynamoAttributeValue
Parameters
- value
Dynamo
Attribute Value []
Returns
Sets an attribute of type List.
For example: "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
Map(value)
static frompublic static fromMap(value: { [string]: DynamoAttributeValue }): DynamoAttributeValue
Parameters
- value
{ [string]:
Dynamo
Attribute Value }
Returns
Sets an attribute of type Map.
For example: "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
Null(value)
static frompublic static fromNull(value: boolean): DynamoAttributeValue
Parameters
- value
boolean
Returns
Sets an attribute of type Null.
For example: "NULL": true
Number(value)
static frompublic static fromNumber(value: number): DynamoAttributeValue
Parameters
- value
number
Returns
Sets a literal number.
For example: 1234 Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
NumberSet(value)
static frompublic static fromNumberSet(value: number[]): DynamoAttributeValue
Parameters
- value
number[]
Returns
Sets an attribute of type Number Set.
For example: "NS": ["42.2", "-19", "7.5", "3.14"] Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
String(value)
static frompublic static fromString(value: string): DynamoAttributeValue
Parameters
- value
string
Returns
Sets an attribute of type String.
For example: "S": "Hello" Strings may be literal values or as JsonPath. Example values:
DynamoAttributeValue.fromString('someValue')
DynamoAttributeValue.fromString(JsonPath.stringAt('$.bar'))
StringSet(value)
static frompublic static fromStringSet(value: string[]): DynamoAttributeValue
Parameters
- value
string[]
Returns
Sets an attribute of type String Set.
For example: "SS": ["Giraffe", "Hippo" ,"Zebra"]
FromJsonPath(value)
static listpublic static listFromJsonPath(value: string): DynamoAttributeValue
Parameters
- value
string
— Json path that specifies state input to be used.
Returns
Sets an attribute of type List.
For example: "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"S", "Veggies"}]
FromJsonPath(value)
static mappublic static mapFromJsonPath(value: string): DynamoAttributeValue
Parameters
- value
string
— Json path that specifies state input to be used.
Returns
Sets an attribute of type Map.
For example: "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
FromString(value)
static numberpublic static numberFromString(value: string): DynamoAttributeValue
Parameters
- value
string
Returns
Sets an attribute of type Number.
For example: "N": "123.45" Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
Numbers may be expressed as literal strings or as JsonPath
SetFromStrings(value)
static numberpublic static numberSetFromStrings(value: string[]): DynamoAttributeValue
Parameters
- value
string[]
Returns
Sets an attribute of type Number Set.
For example: "NS": ["42.2", "-19", "7.5", "3.14"] Numbers are sent across the network to DynamoDB as strings, to maximize compatibility across languages and libraries. However, DynamoDB treats them as number type attributes for mathematical operations.
Numbers may be expressed as literal strings or as JsonPath