AWS Lambda to Amazon SNS to Amazon SQS to AWS Lambda

AWS Lambda → AWS SNS → AWS SQS → AWS Lambda

Creates one Lambda function that sends a message to an SNS topic. That topic sends the message to a SQS queue and finally another Lambda picks the message.

This sample project demonstrates how to create a SNS + SQS system, in which all the messages sent by a publisher are sent to all the consumers, and there is a buffer between the message producer and the consumer. In this way the consumers don't get overload with messages.

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

Deploy

cdk deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: cdk delete.

Additional resources

Created by:

Marcia Villalba

Marcia Villalba

Marcia hosts the FooBar Serverless YouTube channel where she publishes content every week related to serverless and the cloud. She has been designing and developing software professionally for 15 years and worked in all the different stages of building scaling and performant software.

Follow on LinkedIn