top of page

Tutorial blog to create notifications for Amazon EC2 instance state change

Updated: Oct 17

Learning Objective:

a. Learn to set EventBridge notifications for state change in EC2 instances

Step 1:

In AWS Management Console, go to EC2 and create 2 Linux instances. For step-by-step guide to create instances refer to this blog.

Step 2:

Create an SNS topic named MyTopic. Refer to this blog (Step 1,2 and 3) for guidance. In Subscriptions Select Email instead of Email-JSON in Protocol.

Step 3:

Go to EventBridge and click on Rules, Create rule. Give the Name as MyEC2StateChangeEvent and a suitable description. Click on Next

Step 4:

In Build event pattern, under Sample event select EC2 Instance State-change Notification and under Event pattern select EC2 from AWS service and EC2 Instance State-change Notification in Event type. Click on Next.

Step 5:

In Select Target select SNS Topic and the topic we created in Step 2 from dropdown. Click Next till you get to Review and create and Create rule.

Step 6:

Stop the first instance and check the email address specified in the SNS topic. You should have received a mail from SNS topic specifying that instance has stopped.

Now Terminate the second instance. Again you should receive a mail informing about the termination of the instance.

Note: After you have finished, remove the SNS, EventBridge and EC2 instances.

Download PDF • 440KB

Was this document helpful? How can we make this document better. Please provide your insights. You can download PDF version for reference.

For your aws certification needs or for aws learning contact us.

75 views4 comments

Recent Posts

See All
bottom of page