How we send an email if we get an error in a Lambda function by Step Function?


We create a new Lambda Function for send the email. This is the code:

Copy to Clipboard

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:

Copy to Clipboard

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:

Copy to Clipboard

Now we go in our Step Function and change the Notify Error with this code:

Copy to Clipboard

Now our step function can send an email if there is a problem when the instances not started.


Let us know if you have solved the problem!

AWS Certified Solutions Architect Official Study Guide:

AWS Certified Solutions Architect Associate Practice Tests:

Recent Tweets

For privacy reasons Twitter needs your permission to be loaded.
I Accept