Search code examples
amazon-web-servicesaws-step-functions

Calling SNS when AWS Step Function fails


I have implemented a state machine using AWS Step Functions which includes calling some Lambda functions, Spinning EMR cluster, Adding steps to EMR and Terminating EMR cluster. I want to call SNS Topic whenever any of above state fails.


Solution

  • You can create a cloudwatch event to capture the stepfunction failure or time out events and add SNS as the target for this rule.

    to create a cloudwatch rule navigate to cloudwatch -> events -> rules -> create

    this rule can be restricted to a specific stepfunction or a specific execution providing the corresponding ARN

    enter image description here