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.