1 Answer
- Newest
- Most votes
- Most comments
0
ok. while formulating this question i stumbled upon a setting in our aws_ecs_capacity_provider: we have set managed_termination_protection to "ENABLED". According to the AWS docs, this only should be possible in case the protect_from_scale_in is enabled too. But we do not get an error (neither via AWS console nor via terraform apply), nor is the change of the protect_from_scale_in to false automatically disabling the managed_termination_protection. (!)
I have set the managed_termination_protection to "DISABLED" manually via AWS console and hope tomorrow our new EC2 instances will be launched with scale-in-protecion set to false.
answered 3 years ago
Relevant content
- asked 6 years ago
- asked 10 months ago
- asked a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 5 months ago
The requirement is one way. The protect_from_scale_in setting has to be enabled on the ASG for managed_termination_protection to be enabled in ECS; but AutoScaling isn't aware of the ECS capacity provider, and so it lets you turn the setting off on the ASG at any time.
With managed_termination_protection disabled, make sure you have a lifecycle hook on the ASG set to tell ECS to drain the running tasks before instance termination (or some other method to do the same thing). Example: https://aws.amazon.com/blogs/compute/how-to-automate-container-instance-draining-in-amazon-ecs/
Thank you Shahad_C. Just wanted to mention, that managed_termination_protection was the problem indeed. After disabling it, it works fine :)