Skip to content

(stepfunctions-tasks): add DynamoAttributeValue.listFromJsonPath() #17375

@rogerchi

Description

@rogerchi

Description

According to this post https://stackoverflow.com/questions/63419936/how-to-put-array-in-dynamo-db-using-step-function the PutItem API can accept a normal JSON list as input for a list AttributeType and will marshal it into AttributeValues in the background. Add a method DynamoAttributeValue.listFromJsonPath(value: string) so that you can pass in a JsonPath that specifies a list in the input state, e.g. DynamoAttributeValue.listFromJsonPath(JsonPath.stringAt("$.list"))

Use Case

Currently it does not seem possible to create a DynamoDB List element based on a dynamic list in the input state.

Proposed Solution

Add a method DynamoAttributeValue.listFromJsonPath(value: string) so that you can pass in a JsonPath that specifies a list in the input state, e.g. DynamoAttributeValue.listFromJsonPath(JsonPath.stringAt("$.list"))

Other information

It seems like the automatic marshaling only works for lists of strings -- an error is given if other types are in the list e.g. numbers, maps, etc.

Acknowledge

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions