Amazon S3 to AWS Lambda to Amazon DynamoDB

S3 → AWS Lambda → Amazon DynamoDB

Upload object data from S3 to DynamoDB via Lambda.

This pattern in CDK offers a complete solution to load data from CSV files stored on S3. The following resources are created:
- S3 Bucket with event notification on object creates
- DynamoDB Table with on-demand billing mode
- Lambda function that runs python and takes environment variables of bucket name, object key, and dynamodb table

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/s3-lambda-dynamodb-cdk

Deploy

cdk deploy --parameters dataObject=<name of the objects>


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

1. Delete the stack: npx cdk destroy.
2. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus".
3. You see a message confirming DELETE_COMPLETE.

Created by:

Yogananda Karra

Yogananda Karra

Solutions Architect @ AWS.