Amazon API Gateway to Amazon SQS FIFO Queue to AWS Lambda to Amazon SNS

API Gateway → Amazon SQS → AWS Lambda → Amazon SNS

Process HTTP Post requests using Lambda Function while maintaining the order of the messages

This pattern is designed to deploy an Amazon API Gateway HTTP API with a single route at "/".
When the API Gateway receives a request from a client, it immediately sends the message to a FIFO (First-In-First-Out) queue.
The FIFO queue ensures that messages are processed in the order they were received, maintaining strict ordering.
As the messages arrive in the FIFO queue, it automatically invokes a Lambda function responsible for message processing.
The Lambda function handles each message one by one in FIFO order.
Depending on the use case, the function may perform various actions, such as data processing, validation, or invoking other AWS services.
Once the Lambda function has processed a message, it publishes the processed data to an SNS (Simple Notification Service) standard topic.
You can then subscribe an email addresses to the topic, to be notified by email when ther are new 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/apigw-http-api-fifo-sqs-lambda-sns-sam

Deploy

sam deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: sam delete.

Created by:

Xivutiso Makhubela

I am a Startups Solutions Architect at Amazon Web Services

Follow on LinkedIn