I am trying to send alarm emails when some errors are thrown in an AWS Lambda function. I could configure CloudWatch Alarms to send emails via SNS topics by creating an Alarm. If I have a python exception, the alarm is thrown an email is sent. I can see the exception data in the Cloudwatch Logs. However, the emails do not contain the exception data. They are only showing up in the Logs as as follows:
{
"errorMessage": "Example Test Failure",
"errorType": "Exception",
"stackTrace": [
[
"/var/task/lambda_function.py",
7,
"lambda_handler",
"raise Exception('Example Test Failure')"
]
]
}
Is there a way to add this errorMessage
to the text of the SNS email ?