Ordered processing with a synchronous AWS Lambda target on Amazon EventBridge

Amazon EventBridge Custom event bus → AWS Lambda Consumer

Process events in order by invoking an AWS Lambda function synchronously from a FIFO subscriber on an Amazon EventBridge custom event bus.

This pattern shows how an Amazon EventBridge custom event bus (the eventsv2 API) processes events in order by invoking an AWS Lambda function synchronously (InvocationType REQUEST_RESPONSE) from a FIFO subscriber.
The publisher sends a sequence of OrderPlaced events that share one EventGroupId, each carrying a monotonically increasing sequence number. The FIFO subscriber delivers one event per batch and invokes the consumer Lambda synchronously, waiting for each event to be confirmed before delivering the next in the group. The consumer logs each sequence number as it processes, and the CloudWatch log shows the sequence handled in order, one at a time. Synchronous confirmation gives the reliability and back-pressure that teams used to get by adding an SQS queue between the bus and Lambda, so no queue is needed.
This deploys one EventBridge custom event bus, one FIFO subscriber configured for synchronous invocation, one Python 3.14 Lambda function, an SQS dead-letter queue (safety net), and the delivery role.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub

Variants

This pattern is available in the following frameworks/languages:

AWS SAM:JavaPythonTypeScript

Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/eventbridge-custom-lambda-sync/python/sam

Deploy

sam buildsam deploy --guided --capabilities CAPABILITY_NAMED_IAM


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

sam delete

Created by:

Kurt Tometich

Kurt Tometich

Kurt is a Sr. Solutions Architect based in Colorado who enjoys building lean, mean serverless solutions.