aws-cdk-lib.aws_stepfunctions_tasks.DynamoAttributeValue

class DynamoAttributeValue

LanguageType name
.NETAmazon.CDK.AWS.StepFunctions.Tasks.DynamoAttributeValue
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsstepfunctionstasks#DynamoAttributeValue
Javasoftware.amazon.awscdk.services.stepfunctions.tasks.DynamoAttributeValue
Pythonaws_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.

See also: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html

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

NameTypeDescription
attributeValueanyRepresents the data for the attribute.

attributeValue

Type: any

Represents the data for the attribute.

Data can be i.e. "S": "Hello"

Methods

NameDescription
toObject()Returns the DynamoDB attribute value.
static booleanFromJsonPath(value)Sets an attribute of type Boolean from state input through Json path.
static fromBinary(value)Sets an attribute of type Binary.
static fromBinarySet(value)Sets an attribute of type Binary Set.
static fromBoolean(value)Sets an attribute of type Boolean.
static fromList(value)Sets an attribute of type List.
static fromMap(value)Sets an attribute of type Map.
static fromNull(value)Sets an attribute of type Null.
static fromNumber(value)Sets a literal number.
static fromNumberSet(value)Sets an attribute of type Number Set.
static fromString(value)Sets an attribute of type String.
static fromStringSet(value)Sets an attribute of type String Set.
static listFromJsonPath(value)Sets an attribute of type List.
static mapFromJsonPath(value)Sets an attribute of type Map.
static numberFromString(value)Sets an attribute of type Number.
static numberSetFromStrings(value)Sets an attribute of type Number Set.

toObject()

public toObject(): any

Returns

  • any

Returns the DynamoDB attribute value.


static booleanFromJsonPath(value)

public static booleanFromJsonPath(value: string): DynamoAttributeValue

Parameters

  • value string — Json path that specifies state input to be used.

Returns

  • DynamoAttributeValue

Sets an attribute of type Boolean from state input through Json path.

For example: "BOOL": true


static fromBinary(value)

public static fromBinary(value: string): DynamoAttributeValue

Parameters

  • value string — base-64 encoded string.

Returns

  • DynamoAttributeValue

Sets an attribute of type Binary.

For example: "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"


static fromBinarySet(value)

public static fromBinarySet(value: string[]): DynamoAttributeValue

Parameters

  • value string[]

Returns

  • DynamoAttributeValue

Sets an attribute of type Binary Set.

For example: "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]


static fromBoolean(value)

public static fromBoolean(value: boolean): DynamoAttributeValue

Parameters

  • value boolean

Returns

  • DynamoAttributeValue

Sets an attribute of type Boolean.

For example: "BOOL": true


static fromList(value)

public static fromList(value: DynamoAttributeValue[]): DynamoAttributeValue

Parameters

  • value DynamoAttributeValue[]

Returns

  • DynamoAttributeValue

Sets an attribute of type List.

For example: "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]


static fromMap(value)

public static fromMap(value: { [string]: DynamoAttributeValue }): DynamoAttributeValue

Parameters

  • value { [string]: DynamoAttributeValue }

Returns

  • DynamoAttributeValue

Sets an attribute of type Map.

For example: "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}


static fromNull(value)

public static fromNull(value: boolean): DynamoAttributeValue

Parameters

  • value boolean

Returns

  • DynamoAttributeValue

Sets an attribute of type Null.

For example: "NULL": true


static fromNumber(value)

public static fromNumber(value: number): DynamoAttributeValue

Parameters

  • value number

Returns

  • DynamoAttributeValue

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.


static fromNumberSet(value)

public static fromNumberSet(value: number[]): DynamoAttributeValue

Parameters

  • value number[]

Returns

  • DynamoAttributeValue

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.


static fromString(value)

public static fromString(value: string): DynamoAttributeValue

Parameters

  • value string

Returns

  • DynamoAttributeValue

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'))

static fromStringSet(value)

public static fromStringSet(value: string[]): DynamoAttributeValue

Parameters

  • value string[]

Returns

  • DynamoAttributeValue

Sets an attribute of type String Set.

For example: "SS": ["Giraffe", "Hippo" ,"Zebra"]


static listFromJsonPath(value)

public static listFromJsonPath(value: string): DynamoAttributeValue

Parameters

  • value string — Json path that specifies state input to be used.

Returns

  • DynamoAttributeValue

Sets an attribute of type List.

For example: "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"S", "Veggies"}]


static mapFromJsonPath(value)

public static mapFromJsonPath(value: string): DynamoAttributeValue

Parameters

  • value string — Json path that specifies state input to be used.

Returns

  • DynamoAttributeValue

Sets an attribute of type Map.

For example: "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}


static numberFromString(value)

public static numberFromString(value: string): DynamoAttributeValue

Parameters

  • value string

Returns

  • DynamoAttributeValue

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


static numberSetFromStrings(value)

public static numberSetFromStrings(value: string[]): DynamoAttributeValue

Parameters

  • value string[]

Returns

  • DynamoAttributeValue

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