In this hands-on lab, we will create a CloudWatch Events alarm that triggers an SNS email notification. Then, we will trigger the alarm by simulating the shutdown of an EC2 instance.
Successfully complete this lab by achieving the following learning objectives:
- Create an SNS Topic and Subscribe an Email Address
- Create an SNS topic.
- Subscribe an email address.
- Confirm your subscription to the newly created SNS topic.
- Create a CloudWatch Events Rule to Trigger the SNS Topic When There is a State Change to an EC2 Instance
Create a CloudWatch Events rule to trigger the newly created SNS topic whenever there is a state change to an EC2 instance.
- Change the State of the EC2 Instance, and Verify the Receipt of the SNS Notification
- In the EC2 console, change the state of the EC2 instance to stop.
- Next, check your email to verify that you received the SNS notification that a state change has occurred to an EC2 instance.