1
votes

In AWS it is possible to set an alarm for an EC2 instance, using CloudWatch to reboot, recover, stop, etc an EC2 instance based on memory, cpu, network, disk usage.

My problem is that my EC2 instances are managed by Beanstalk and when Beanstalk is replacing an EC2 instance, any alarm that is set on the instance is lost.

In Beanstalk interface, from monitoring is possible to set alarms by clicking on the bell for desired topic (CPU, memory, network, disk), but the only option for those alarms is notify, not reboot, recover, stop.

My question is: How can I set from Beanstalk alarms for EC2 instance to reboot the instance when CPU goes over 80%?

1

1 Answers

1
votes

I believe the Beanstalk way to do it is NOT by setting an external trigger. Beanstalk is more of a closed garden, managing its own instances.
In the Beanstalk console check out Configuration>Scaling Trigger>Trigger measurement.
You'll see that there's an option to set the scaling (up/down) via CPU utilization, which is what you requested.