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%?