In this blog, we will show you the steps to configure E-mail notification for EC2 Instance in AWS.
- We created a t2, micro EC2 windows instance for this demo.
CREATING SNS (SIMPLE NOTIFICATION SERVICE) TOPIC
- Login in to your AWS account and search for SNS service.
- Select the Topics option.
- Click on Create Topic button.
- Provide the Name and Display Name and click on Create topic.
- Under Subscription topic, select the Create subscription option.
- From the create subscription window, select the protocol as E-mail from the drop-down list.
- Provide your e-mail address and click on create the subscription.
- You will receive a confirmation E-mail to your inbox. Click on the confirm subscription link.
- Once you confirmed the subscription, the status will be changed to confirmed in SNS.
CREATING RULES IN CLOUDWATCH
- From the services page, search for cloudwatch.
- Select the Rules link and click on create rule button.
- Under Event Source, select the service name as EC2 and event type as EC2 Instance State-change Notification.
- We select EC2 state as stopped and terminated for the drop-down list.
- In the target section, click on Add target.
- From the drop-down list, select SNS topic and select our newly created topic.
- Review all the selected settings and click on Configure details. Provide the name and description for this rule and click on create rule button.
- The rule created successfully.
- For testing purpose, Goto EC2 Instance page, and shut down the machine.
- Once the instance state has been changed to stop, you will receive the notification mail to your inbox.
Thanks for reading this blog. We hope it was useful for you to learn about the steps to configure E-mail notification for EC2 instance