Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customize alarm message from AWS Cloudwatch

I got some alarm notifications from AWS Cloudwatch to my email but they are usually sent in a JSON format and the problem is that some of those emails are getting received by non-technical people in my company. I was wondering if that is possible to customize the emails sent by AWS SNS because I don't see any option in how to customize it.

like image 346
VaTo Avatar asked Nov 26 '18 18:11

VaTo


People also ask

How do I send an email from my CloudWatch alarm?

Amazon CloudWatch uses Amazon SNS to send email. First, create and subscribe to an SNS topic. When you create a CloudWatch alarm, you can add this SNS topic to send an email notification when the alarm changes state. For more information, see the Amazon Simple Notification Service Getting Started Guide.

How do you set an alarm on AWS CloudWatch?

Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . In the navigation pane, choose Instances. Select the instance and choose Actions, Monitor and troubleshoot, Manage CloudWatch alarms. On the Manage CloudWatch alarms detail page, under Add or edit alarm, select Create an alarm.

What actions can I take from a CloudWatch alarm?

Using Amazon CloudWatch alarm actions, you can create alarms that automatically stop, terminate, reboot, or recover your EC2 instances. You can use the stop or terminate actions to help you save money when you no longer need an instance to be running.


1 Answers

If you are using Cloudwatch/Event/Rules then you can use "Input transfomer" to customize the contents of the email and then SNS will send that instead of JSON.

I am using this setup to get notified when user signs in AWS console. In my case "Event Source" is "AWS Console Sign-in" but you can try with Cloudwatch and see if that gets you what you need.

See the screenshot, hope it helps.

https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/CloudWatch-Events-Input-Transformer-Tutorial.html

https://forums.aws.amazon.com/thread.jspa?messageID=820808

enter image description here

like image 80
caba Avatar answered Sep 28 '22 00:09

caba