PRECONDITION
How we send an email if we get an error in a Lambda function by Step Function?
PROCEDURE
We create a new Lambda Function for send the email. This is the code:
You must be careful to the values passed as input. It’s necessary add a new role at this function because we use an other service: SNS. This is the JSON code:
So, we need o create a Topics under the SMS service. It’s necessary to create a subscriptions with our email. Copy the arn Topics and paste this in our code at this point:
Now we go in our Step Function and change the Notify Error with this code:
Now our step function can send an email if there is a problem when the instances not started.
CONCLUSIONS
Let us know if you have solved the problem!
Leave A Comment