Protobuf on an Amazon EventBridge Custom Event Bus

AWS Glue → Amazon EventBridge → AWS Lambda → Amazon SQS DLQ → Amazon CloudWatch

Publish a Protobuf event to an Amazon EventBridge Custom Event Bus, decoded against an AWS Glue Schema Registry, and deliver it as JSON to AWS Lambda.

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 an AWS Lambda subscriber.
The publisher encodes an OrderPlaced event from a .proto definition and wraps it in the AWS Glue wire format, including the message index that tells AWS Glue which message type to decode. Amazon EventBridge decodes the Protobuf against the AWS Glue registry server-side and delivers the payload as plain JSON, so the consumer AWS Lambda function needs no Protobuf library and simply logs the event to Amazon CloudWatch. A matching orderId, fields, and metadata prove the delivered event equals the one that was published.
This deploys one Amazon EventBridge Custom Event Bus, one subscriber, an AWS Glue Schema Registry and Protobuf schema, one Node.js 24 (TypeScript) AWS Lambda function, an Amazon 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


Clone repo

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

Deploy

npm installsam buildsam deploy --guided --capabilities CAPABILITY_NAMED_IAM


Testing

Publish one Protobuf OrderPlaced event with scripts/run_publish.sh <stack-name> <region>, then find the decoded JSON event in the consumer's Amazon CloudWatch logs. The script prints the exact log command for your stack.
See the GitHub repo for the commands and expected output.

Cleanup

Delete the stack: sam delete

Created by:

Kurt Tometich

Kurt Tometich

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