- Newest
- Most votes
- Most comments
Create a state machine in Step Functions that starts with a lambda function to check for failures and use a combination of wait states and choice states in Step Functions to handle the different reporting intervals.Once the wait period is over, the state machine triggers another lambda function to send the email via SES.
Hello.
You can easily configure settings to issue a message the moment a Lambda error occurs.
https://aws.amazon.com/jp/blogs/mt/monitor-your-lambda-function-and-get-notified-with-aws-chatbot/
However, if you are trying to achieve a configuration that sends all errors over a certain period of time as a message, I think you will need to devise a bit.
As you know, I think it is possible to store error messages for a certain period of time in a database (such as DynamoDB) and notify them.
Another method is to run CloudWatch Logs Insights on Lambda for a certain period of time and send the message after querying error messages from Lambda's log group.
This is possible using the "start_query" API and "get_query_results".
However, be aware that this approach can become expensive as the amount of logs increases.
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/logs/client/start_query.html
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/logs/client/get_query_results.html
Relevant content
- Accepted Answerasked 4 months ago
- asked 2 years ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a month ago