Amazon API Gateway HTTP API to Amazon SQS

API Gateway → SQS

Create an Amazon API Gateway HTTP 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


Launch Stack

Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/apigw-sqs-lambda

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:

Ilyas Bakouch

Ilyas Bakouch

Senior Solutions Architect, AWS.