Search code examples
amazon-web-servicesamazon-ecsaws-auto-scaling

ECS CapacityProvider not Scaling in


According to the docs, https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-auto-scaling.html#update-ecs-resources-cas enter image description here Looking at the services, I have 3 services. 2 Replicas are both running on a single host and a DAEMON is on both hosts. So per the docs, the scale in protection should've been removed, and the error mentioned in the 2nd image below shouldn't have come.

I am facing the exact issue as this SO post but that is still unanswered.

Current Capacity Provider state: enter image description here

Error in ASG: enter image description here

Service definitions:

enter image description here

2 Replicas + 1 DAEMON in the first instance (first three tasks) 1 DAEMON in the second instance should've been removed due to scale-in, but it isn't.

enter image description here

Capacity Provider configuration: enter image description here


Solution

  • It turns out, this was because AmazonECSManaged tag was missing in the ASG. After adding AmazonECSManaged=true, the cluster was able to scale-in

    enter image description here

    enter image description here