amazon-web-servicesaws-lambdaamazon-cloudwatchcloudwatch-alarms

Create CloudWatch Alarm based on Lambda - including meta information in email


I have the following work flow:

As a basic form of 'predictive maintenance', I now wish to create an automated Alarm.

The best approach seems to be to create a CloudWatch Metric, set up a CloudWatch Alarm based on this and trigger a new SNS Topic that users can be subscribed to.

The above setup works - but the email is 'static' (i.e. I can't dynamically parse content into it). I would like to somehow parse the meta information through this workflow so that the body/title of the email may contain the aforementioned meta variables. The goal is to enable the recipient of the email to take direct action, without having him/her browse through CloudWatch logs.

Is there a simple way to achieve this that can be deployed via the AWS console, rather than e.g. having to resort to triggering a new Lambda?


Solution

  • You can use EventBridge events & rules to catch a spcific event of a trigred alarm and use it with an input transformer rule that can parse the detail of the event so you can customize your email based on details in your logs.

    Check this AWS docs and tutorial.