Amazon EventBridge to AWS Step Functions and failure events to Amazon SQS

Amazon EventBridge → Step Functions → SQS

Create a Step Functions workflow to Send Failure event to SQS for operational needs.

This sample project demonstrates how to use an AWS Step Functions state machine to send failure event to SQS.
This pattern is leveraging the native integration between the eventBridge to step function andto SQS services . Successfull event invokes Step function and executes lambda function successfully and completes the step function state machine successfully. Failure event invokes Step function and executes lambda function which throws custom exception and get retried 2 times using Step function error hanlder. After retry is exhausted, Catch handler moves the state machine Failure SQS. Stepfunction writes Failure message to the SQS using native 'SendMessage' task which can be handled for operational needs.
This pattern deploys one Step Functions, two SQS queue, one Custom Event bus and one 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/cdk-eventbridge-stepfunction-sqs

Deploy

cdk deploy


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: cdk delete.

Created by:

Shankar Srinivasan

I am a Cloud Application Architect at AWS. I specialize in architecting and developing serverless, event-driven solutions on AWS.

Follow on LinkedIn