Codementor Events

Getting notified for any state change in the AWS resources (like EC2 going down)

Published Dec 06, 2020
Getting notified for any state change in the AWS resources (like EC2 going down)

EC2 can be used for any purpose like running a website, doing some processing. A website has a requirement to run 99.9 or 99.99 or some other percentage of the time, so back up of the EC2 instances are required for the sake of high availability. But, lets take the case of batch as in the case of transforming 1000's of records from one format to another, then high availability is not really important.g here...

in the case as in the case of web servers we need some level of high availability and so multiple EC2 instances (backup), but in the case of processing there is no need of backup.

It would be good to get some sort of notification when the instance goes down

Step 1: Create a new topic in the SNS management console.

2.PNG
Step 2: Subscribe to the topic created in the previous step.

3.PNG

Step 3: You should be getting an email with a link, click on it to confirm the subscription and the status of the subscription changes on refreshing the screen.

4.PNG

Step 4: Start a Linux EC2 instance as mentioned here and note down the instance
id.

5.PNG
Step 5: Create a rule in the Cloud Watch Management Console for the appropriate instance and the events

6.PNG

Step 6: Perform different actions on the EC2 and you will notice that you would be getting an email.

7.PNG

Note : the above procedure can be used for getting a notification of any state changes in the AWS resources

Discover and read more posts from Naveen
get started
post commentsBe the first to share your opinion
Show more replies