Protobuf on an Amazon EventBridge custom event bus

Amazon EventBridge Custom event bus → AWS Glue Schema Registry → AWS Lambda Consumer

Publish a Protobuf-encoded event to an Amazon EventBridge custom event bus with an AWS Glue Schema Registry, and deliver the decoded JSON to an AWS Lambda function.

This pattern shows how to publish a rich domain event, Protobuf-encoded, to an Amazon EventBridge custom event bus (the eventsv2 API) using PutRawEvents together with an AWS Glue Schema Registry, and then deliver that same event to a Lambda subscriber.
The publisher encodes an OrderPlaced event from a .proto definition and wraps it in the Glue wire format (including the message-index that tells Glue which message type to decode as). EventBridge decodes the Protobuf against the Glue registry server-side and delivers the payload as plain JSON, so the consumer Lambda needs no Protobuf library and logs the event to CloudWatch. A matching orderId, fields, and metadata show the delivered event matches the published one.
This deploys one EventBridge custom event bus, one subscriber, an AWS Glue Schema Registry and Protobuf schema, one Python 3.14 Lambda function, an SQS dead-letter queue, 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:PythonTypeScript

Clone repo

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

Deploy

scripts/generate.shsam 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.