DynamoAttributeValue

class aws_cdk.aws_stepfunctions_tasks.DynamoAttributeValue(*args: Any, **kwargs)

Bases: object

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:

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

ExampleMetadata:

infused

Example:

# my_table: dynamodb.Table

tasks.DynamoDeleteItem(self, "DeleteItem",
    key={"MessageId": tasks.DynamoAttributeValue.from_string("message-007")},
    table=my_table,
    result_path=sfn.JsonPath.DISCARD
)

Methods

to_object()

Returns the DynamoDB attribute value.

Return type:

Any

Attributes

attribute_value

Represents the data for the attribute.

Data can be i.e. “S”: “Hello”

Static Methods

classmethod boolean_from_json_path(value)

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

For example: “BOOL”: true

Parameters:

value (str) – Json path that specifies state input to be used.

Return type:

DynamoAttributeValue

classmethod from_binary(value)

Sets an attribute of type Binary.

For example: “B”: “dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk”

Parameters:

value (str) – base-64 encoded string.

Return type:

DynamoAttributeValue

classmethod from_binary_set(value)

Sets an attribute of type Binary Set.

For example: “BS”: [“U3Vubnk=”, “UmFpbnk=”, “U25vd3k=”]

Parameters:

value (Sequence[str]) –

Return type:

DynamoAttributeValue

classmethod from_boolean(value)

Sets an attribute of type Boolean.

For example: “BOOL”: true

Parameters:

value (bool) –

Return type:

DynamoAttributeValue

classmethod from_list(value)

Sets an attribute of type List.

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

Parameters:

value (Sequence[DynamoAttributeValue]) –

Return type:

DynamoAttributeValue

classmethod from_map(value)

Sets an attribute of type Map.

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

Parameters:

value (Mapping[str, DynamoAttributeValue]) –

Return type:

DynamoAttributeValue

classmethod from_null(value)

Sets an attribute of type Null.

For example: “NULL”: true

Parameters:

value (bool) –

Return type:

DynamoAttributeValue

classmethod from_number(value)

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.

Parameters:

value (Union[int, float]) –

Return type:

DynamoAttributeValue

classmethod from_number_set(value)

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.

Parameters:

value (Sequence[Union[int, float]]) –

Return type:

DynamoAttributeValue

classmethod from_string(value)

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

Parameters:

value (str) –

Return type:

DynamoAttributeValue

classmethod from_string_set(value)

Sets an attribute of type String Set.

For example: “SS”: [“Giraffe”, “Hippo” ,”Zebra”]

Parameters:

value (Sequence[str]) –

Return type:

DynamoAttributeValue

classmethod list_from_json_path(value)

Sets an attribute of type List.

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

Parameters:

value (str) – Json path that specifies state input to be used.

Return type:

DynamoAttributeValue

classmethod map_from_json_path(value)

Sets an attribute of type Map.

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

Parameters:

value (str) – Json path that specifies state input to be used.

Return type:

DynamoAttributeValue

classmethod number_from_string(value)

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

Parameters:

value (str) –

Return type:

DynamoAttributeValue

classmethod number_set_from_strings(value)

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

Parameters:

value (Sequence[str]) –

Return type:

DynamoAttributeValue