Tracking your AWS Step Function
Piyush Gupta
Data engineer and AWS specialist with an increasing interest in machine learning, statistics, actuarial sciences, and discovering the beauty in the Risk ??(Insurance Domain)
How can we track our AWS Step Function? There doesn't seem to be a direct way when we try to search on the AWS console.
We can add an SNS Publish state inside the flow itself. We have to add error catch block on each state (pointing to the Publish state). That is too much work when still suffering from Monday Blues.
So, is there a simple way to create a notification for step function failure/success? Well, if you have an event driven mind, I imagine you screaming 'Cloud Watch Rules' and you will be right.
There is a rule to track the execution state change for a step function. Specifically, the search for 'Step Functions Execution Status Change' event type and the rest is pretty intuitive.
We can select the Step Function State Machine we want to track, which state changes (Success, Failure, Aborted etc.) we want to trigger the events on.
And of course we can choose SNS as target.
For example, here is a sample event definition for tracking success/failure state change.
{
"source": ["aws.states"],
"detail-type": ["Step Functions Execution Status Change"],
"detail": {
"status": ["FAILED", "SUCCEEDED"],
"stateMachineArn": ["arn:aws:states:us-east-1:99******99:stateMachine:my-state-machine"]
}
}
And, here is a screenshot of the AWS console while defining the rule:
Hope this will help you in making your processes more robust and easier to monitor.
#genpact #aws #dataengineering #cloud #microservices