Amazon SQS to AWS Lambda with AWS Step Functions enrichment

SQS → EventBridge Pipes → Enrichment → AWS Lambda

SQS to Lambda with Step functions enrichment using EventBridge Pipes

SQS queue is polled and messages are sent to Step Functionsworkflow, the workflow enriches the event and forwards them onto the Lambda function
How the pattern works
EventBridge pipe polls SQS messages and delivers them to the Lambda function with enriched information from a Step Functionsworkflow.
This example uses DynamoDB to enrich the message flowing through the pipe. The `order_id` is read from the SQS message and used to look up order information for the downstream Lambda function.
Important enrichment facts to know
1. If you don't want targets to get hit from enrichment you need to return an empty value (more info in docs)
2. Make sure you return an array from your enrichment so pipes knows how to trigger your target. Data flowing from enrichment to target must be an array

< 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/eventbridge-pipes-sqs-to-lambda-with-stepfunction-enrichment

Deploy

sam deploy --guided


Testing

See the README in the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: sam delete.

Created by:

David Boyne

David Boyne

Helping people learn about event-driven architectures and serverless

Follow on LinkedIn