Batch write data to DynamoDB

Transform and batch data to a DynamoDB table

In this project, a Step Functions state machine invokes a Lambda function to get data to be written to a DynamoDB Table. The Lambda function generates an array of JSON objects containing random sample data.
A Map state converts the JSON array to a BatchWriteItem compatible DynamoDB JSON Array. This data is then passed to a Distributed Map State which performs batching of 25 items. This batching is necessary to comply with the validation requirements of the BatchWriteItem API in DynamoDB.

< Back to all workflows

GitHub icon View this workflow on GitHub


Clone repo

git clone https://github.com/aws-samples/step-functions-workflows-collection/tree/main/sfn-dynamodb-batchwriteitem/cd step-functions-workflows-collection/sfn-dynamodb-batchwriteitem

Deploy

sam deploy -g


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: sam delete.

Created by:

Udit Parikh

Udit Parikh

Udit is passionate about serverless & event-driven architectures.

Follow on LinkedIn