Craig Efrein
Craig Efrein

Reputation: 139

AWS Cloudwatch Alarm not stopping EC2 instance

I have created an alarm in Cloudwatch to stop my EC2 instance, if the CPU < 5% for more than five minutes.

enter image description here

And after five minutes I get the email but the instance continues running. The instance is using an EBS volume and nothing in the history indicates a problem.

Can someone please tell me why the alarm I setup is not stopping the instance?

Thanks

Upvotes: 3

Views: 1083

Answers (2)

Mahdi
Mahdi

Reputation: 3349

According to the documentation, you need to create an IAM role so that AWS can automatically stop the instance on your behalf when the alarm is triggered. Also note that you cannot assign an IAM role to an existing instance.

Update:

You can now attach to or modify an IAM role of your existing instance. Read more here.

Upvotes: 3

vighanesh mandavkar
vighanesh mandavkar

Reputation: 151

I am new to aws part,hope this may help...not sure... Amazon EBS may not send metric data for an available volume that is not attached to an Amazon EC2 instance, because there is no metric activity to be monitored for that volume. If you have an alarm set for such a metric, you may notice its state change to Insufficient Data. This may simply be an indication that your resource is inactive, and may not necessarily mean that there is a problem.

Upvotes: 0

Related Questions