Is there a way to automatically terminate unhealthy EC2 instances from ELB?
Is there a way to have either the ELB or the EC2 autoscale group shutdown (or reload) unhealthy instances from the ELB?
Our interface has certain database failure conditions that make it unhealthy, so ELB will stop routing traffic to it. This instance is also part of an autoscale group that scales on a peer-to-peer basis. So what happens is that the instance no longer receives traffic from the ELB, so it has no CPU load and overloads the CPU load, thereby twisting the scaling conditions.
Is there an easy way to somehow configure an ELB or autoscaling group to automatically stop using unhealthy instances from the group without having to write code to poll and complete through the EC2 API?
source to share
If you set the autoscaling group health check type to ELB, then it will automatically delete all instances that will not check the ELB health (i.e. does not respond in a timely manner to the configured URL)
As long as the configured health check correctly reports that the instance is bad (it looks like it does because you say the ELB indicates that this instance is bad for health), this should work
source to share