What happens with EC2 Instance when It fails status check fail and it has termination protection ON

0

I want to understand this scenario like if I have termination protection ON against EC2 instance which has been created through autoscaling group. What happens if the status check fails or due to some reason instance got crashes will it be swap the instance (terminate and recreate new one). Is it recommend to enable termination protection on for EC2 instance which has autoscaling group

3 Risposte
3
Risposta accettata

Termination protection for AWS EC2 instances does not prevent termination due to scheduled maintenance, Auto Scaling actions (like during scale-in events or for unhealthy instances), and cannot be applied to Spot Instances. It mainly protects against accidental deletions.

Resources:

profile picture
ESPERTO
con risposta 3 mesi fa
profile picture
ESPERTO
verificato 2 mesi fa
profile picture
ESPERTO
verificato 3 mesi fa
profile pictureAWS
ESPERTO
verificato 3 mesi fa
0

Hi,

In the scenario where the instance fails the status checks or crashes, the Auto Scaling group will attempt to recover the instance according to its configured settings. This might involve performing actions like stopping and starting the instance, or terminating and replacing the instance if it cannot be recovered. However, if termination protection is enabled on the instance, the Auto Scaling group will not be able to terminate it directly.

  1. Criticality of Instances: If the instances in your Auto Scaling group are critical to your application's availability and you want to minimize the risk of accidental termination, enabling termination protection can provide an additional layer of safety.
2)Automation and Monitoring: You should have robust automation and monitoring in place to handle instances that fail status checks or encounter issues. This ensures that any issues are detected and addressed promptly, even if termination protection is enabled.
3)Manual Interventions: Enabling termination protection means that manual interventions to terminate instances will not work. If you need the ability to manually terminate instances for maintenance or troubleshooting purposes, you may need to disable termination protection temporarily.

4)Cost Considerations: Keeping instances running indefinitely due to termination protection can incur costs. Ensure that you have processes in place to review and manage instances effectively to avoid unnecessary costs.
profile picture
con risposta 3 mesi fa
0

This scenario, where an instance that has been launched by an auto-scaling group then fails an instance check, is described in https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstances.html#InitialSteps

  • If your instance is in an Auto Scaling group, the Amazon EC2 Auto Scaling service automatically launches a replacement instance. For more information, see Health Checks for Auto Scaling Instances in the Amazon EC2 Auto Scaling User Guide.

Not the same as Termination Protection, but still worth mentioning here, is Scale-In Protection which can prevent an instance being terminated by an auto-scaling group https://docs.aws.amazon.com/autoscaling/ec2/userguide/ec2-auto-scaling-instance-protection.html

profile picture
ESPERTO
Steve_M
con risposta 3 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande