[{"data":1,"prerenderedAt":88},["ShallowReactive",2],{"pattern-eventbridge-custom-avro-python-sam":3,"pattern-group-eventbridge-custom-avro-python-sam":87},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":11,"deploy":13,"description":17,"extension":18,"framework":19,"gitHub":20,"highlight":6,"introBox":24,"language":30,"level":31,"meta":32,"patternArch":33,"patternGroup":6,"patternGroupLabel":6,"resources":68,"stem":79,"testing":80,"videoId":6,"__hash__":86},"patterns\u002Fpatterns\u002Feventbridge-custom-avro-python-sam.json","Avro on an Amazon EventBridge custom event bus",null,{"text":8},[9,10],"Delete the stack: \u003Ccode>sam delete\u003C\u002Fcode>.","Confirm the stack has been deleted: \u003Ccode>aws cloudformation list-stacks --query \"StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus\"\u003C\u002Fcode>",[12],"content\u002Fcontributors\u002Fkurt-tometich.json",{"text":14},[15,16],"sam build","sam deploy --guided --capabilities CAPABILITY_NAMED_IAM","Publish an Avro event to an Amazon EventBridge custom event bus, decoded against an AWS Glue Schema Registry, and deliver it as JSON to AWS Lambda.","json","AWS SAM",{"template":21},{"patternPath":22,"templateFile":23},"eventbridge-custom-avro\u002Fpython\u002Fsam","template.yaml",{"headline":25,"text":26},"How it works",[27,28,29],"This pattern shows how to publish a rich domain event, Avro-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 against an Avro schema and wraps it in the AWS Glue wire format. Amazon EventBridge decodes the Avro against the AWS Glue registry server-side and delivers the payload as plain JSON, so the consumer AWS Lambda function needs no Avro 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 Avro schema, one Python 3.14 AWS Lambda function, an Amazon SQS dead-letter queue, and the delivery role.","Python","200",{},{"icon1":34,"icon2":39,"icon3":43,"icon4":48,"icon5":52,"line1":56,"line2":60,"line3":63,"line4":66},{"x":35,"y":36,"service":37,"label":38},8,50,"glue","AWS Glue",{"x":40,"y":36,"service":41,"label":42},32,"eventbridge","Amazon EventBridge",{"x":44,"y":45,"service":46,"label":47},67,30,"lambda-event-functions","AWS Lambda",{"x":44,"y":49,"service":50,"label":51},70,"sqs","Amazon SQS DLQ",{"x":53,"y":45,"service":54,"label":55},88,"cloudwatch","Amazon CloudWatch",{"from":57,"to":58,"label":59},"icon1","icon2","schema",{"from":58,"to":61,"label":62},"icon3","JSON",{"from":58,"to":64,"label":65},"icon4","on failure",{"from":61,"to":67},"icon5",{"bullets":69},[70,73,76],{"text":71,"link":72},"Amazon EventBridge event buses","https:\u002F\u002Fdocs.aws.amazon.com\u002Feventbridge\u002Flatest\u002Fuserguide\u002Feb-event-bus.html",{"text":74,"link":75},"AWS Glue Schema Registry","https:\u002F\u002Fdocs.aws.amazon.com\u002Fglue\u002Flatest\u002Fdg\u002Fschema-registry.html",{"text":77,"link":78},"Apache Avro specification","https:\u002F\u002Favro.apache.org\u002Fdocs\u002F","patterns\u002Feventbridge-custom-avro-python-sam",{"text":81},[82,83,84,85],"Install the publisher dependencies: `python3 -m venv .venv && .\u002F.venv\u002Fbin\u002Fpip install -r publisher\u002Frequirements.txt`","Publish one Avro `OrderPlaced` event: `scripts\u002Frun_publish.sh \u003Cstack-name> \u003Cregion>`","View the delivered event: `aws logs tail \u002Faws\u002Flambda\u002Favro-orders-consumer --since 5m --format short`","See the GitHub repo for detailed testing instructions.","o4ekaTnm129aju4N7COke8eDY-Xq2LrNuZPivj8_sS0",[],1794310734476]