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개 답변
3
수락된 답변

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
전문가
답변함 3달 전
profile picture
전문가
검토됨 2달 전
profile picture
전문가
검토됨 3달 전
profile pictureAWS
전문가
검토됨 3달 전
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
답변함 3달 전
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
전문가
Steve_M
답변함 3달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠