[{"data":1,"prerenderedAt":86},["ShallowReactive",2],{"pattern-eventbridge-archive-replay-sfn-typescript-cdk":3,"pattern-group-eventbridge-archive-replay-sfn-typescript-cdk":6},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":10,"deploy":12,"description":18,"extension":19,"framework":20,"gitHub":21,"highlight":6,"introBox":25,"language":31,"level":32,"meta":33,"patternArch":34,"patternGroup":6,"patternGroupLabel":6,"resources":70,"stem":81,"testing":82,"videoId":6,"__hash__":85},"patterns\u002Fpatterns\u002Feventbridge-archive-replay-sfn-typescript-cdk.json","Amazon EventBridge archive replay started by AWS Step Functions",null,{"text":8},[9],"\u003Ccode>npx cdk destroy\u003C\u002Fcode>",[11],"content\u002Fcontributors\u002Fnithin-chandran-r.json",{"text":13},[14,15,16,17],"\u003Ccode>npm install\u003C\u002Fcode>","\u003Ccode>npm run build\u003C\u002Fcode>","\u003Ccode>npx cdk bootstrap\u003C\u002Fcode> (once per account and Region)","\u003Ccode>npx cdk deploy\u003C\u002Fcode>","Replay lost Amazon EventBridge events after an outage: an Amazon CloudWatch alarm returning to OK starts an AWS Step Functions workflow that calls StartReplay for one rule.","json","AWS CDK",{"template":22},{"patternPath":23,"templateFile":24},"eventbridge-archive-replay-sfn\u002Ftypescript\u002Fcdk","lib\u002Feventbridge-archive-replay-sfn-stack.ts",{"headline":26,"text":27},"How it works",[28,29,30],"A custom Amazon EventBridge bus archives its events. A rule on the bus has a target that fails, and an Amazon CloudWatch alarm watches the `FailedInvocations` metric of that rule.","When the alarm goes from ALARM to OK, a rule on the default bus starts an AWS Step Functions workflow. It reads the alarm history for the outage start, waits for the archive, calls `StartReplay` with the failing rule as the only destination filter, and polls `DescribeReplay`.","The workflow publishes the replay result to Amazon Simple Notification Service. It uses AWS SDK integrations only, so the template contains no AWS Lambda function.","TypeScript","300",{},{"icon1":35,"icon2":40,"icon3":44,"icon4":48,"icon5":53,"line1":57,"line2":61,"line3":64,"line4":67},{"x":36,"y":37,"service":38,"label":39},10,47,"cloudwatch","Amazon\nCloudWatch\nAlarm",{"x":41,"y":37,"service":42,"label":43},33,"eventbridge-rule","Amazon\nEventBridge\nRule",{"x":45,"y":37,"service":46,"label":47},54,"sfn","AWS Step Functions\nReplay",{"x":49,"y":50,"service":51,"label":52},86,20,"eventbridge","Amazon EventBridge\nArchive",{"x":49,"y":54,"service":55,"label":56},68,"sns","Amazon SNS\nResult",{"from":58,"to":59,"label":60},"icon1","icon2","Back to OK",{"from":59,"to":62,"label":63},"icon3","Start",{"from":62,"to":65,"label":66},"icon4","StartReplay",{"from":62,"to":68,"label":69},"icon5","Publish",{"bullets":71},[72,75,78],{"text":73,"link":74},"Archiving and replaying events in Amazon EventBridge","https:\u002F\u002Fdocs.aws.amazon.com\u002Feventbridge\u002Flatest\u002Fuserguide\u002Feb-archive.html",{"text":76,"link":77},"Amazon EventBridge StartReplay API reference","https:\u002F\u002Fdocs.aws.amazon.com\u002Feventbridge\u002Flatest\u002FAPIReference\u002FAPI_StartReplay.html",{"text":79,"link":80},"AWS SDK service integrations in AWS Step Functions","https:\u002F\u002Fdocs.aws.amazon.com\u002Fstep-functions\u002Flatest\u002Fdg\u002Fsupported-services-awssdk.html","patterns\u002Feventbridge-archive-replay-sfn-typescript-cdk",{"text":83},[84],"See the GitHub repo for detailed testing instructions.","RnvzVoTZNsvCZOKck5oz-3zgRFgeJhlAOjvG9cD7KaI",1795084463513]