I would like to get notified via email, whenever an ec2 instance is created/terminated in my AWS account. How can I achieve this?
Question 5: Can a user get a notification of each instance start / terminate configured with Auto Scaling? Explanation:The user can get notifications using SNS if he has configured the notifications while creating the Auto Scaling group.
To set up an SNS topicSubscribe your email address to the topic using the subscribe command. If the subscription request succeeds, you receive a confirmation email message. From your email application, open the message from AWS Notifications and confirm your subscription.
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.
The easiest method (IMO) to do that is to use CloudWatch Events service along with an SNS topic configured to send out emails to your email ID.
In AWS web console, go to CloudWatch -> Events (On left panel) -> Rules -> 'Create rule'
In 'Event Source' choose 'Event Pattern'. Then choose 'Events By Service'. In front of 'Service Name' select 'EC2' and for 'Event Type', select 'EC2 Instance State-change Notification'. You can either choose 'Any State' to get a notification on every state-change or choose specific state you are interested in ('Running' and 'Terminated'|'Stopped' might be of your interest). On the right, Click 'Add target' and then choose 'SNS topic' from dropdown. Then choose an SNS topic that you have configured already to send notification emails to your email ID.
Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With