Amazon EventBridge archive replay started by AWS Step Functions

Amazon CloudWatch Alarm → Amazon EventBridge Rule → AWS Step Functions Replay → Amazon EventBridge Archive → Amazon SNS Result

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.

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.

< 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-archive-replay-sfn/typescript/cdk

Deploy

npm installnpm run buildnpx cdk bootstrap (once per account and Region)npx cdk deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

npx cdk destroy

Created by:

Nithin Chandran R

Nithin Chandran R

Technical Account Manager at AWS