Amazon API Gateway REST API to Amazon SQS

Amazon API Gateway → Amazon SQS

Create an Amazon API Gateway REST API that integrates with an Amazon SQS queue.

In this pattern, called "Queue based leveling", a serverless queue is introduced between your API Gateway and your workers, a Lambda function in this case.
The queue acts as a buffer to alleviate traffic spikes and ensure your workload can sustain the arriving load by buffering all the requests durably.
It also helps downstream consumers to process the incoming requests at a consistent pace.

< 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/apigw-sqs-rest

Deploy

sam deploy --guided


Testing

See the repo for detailed testing notes.

Cleanup

1. Delete the stack: sam delete --stack-name STACK_NAME.
2. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus"

Created by:

Abdul Waheed

Abdul Waheed

Solutions Architect @ AWS