Amazon SQS to AWS Lambda to Amazon DynamoDB with Amazon CloudWatch Alarms

Amazon SQS queue → AWS Lambda → Amazon DynamoDB

Preventing Amazon DynamoDB write throttling with an Amazon SQS queue-based buffer using CDK and monitoring with CloudWatch alarms.

This code demonstrates how an Amazon SQS queue can be used to buffer records for an Amazon DynamoDB table and mitigate the risk for a client of being throttled.
The CDK code deploys Ingress and Dead-Letter SQS queues, AWS Lambda functions, destination DynamoDB tables and CloudWatch alarms.
AWS Lambda function uses NodeJS 20 runtime.

< 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/sqs-lambda-ddb-cdk-ts

Deploy

cdk deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

cdk destroy

Created by:

Andrei Stan

Andrei Stan

Cloud Application Developer, AWS.

Follow on LinkedIn

Willes Mendoza

Willes Mendoza

Cloud Application Developer, AWS.

Follow on LinkedIn