0
votes

I wanted to know if there is any AWS documentation that says how aws ecs service pick which task to terminate when an scaling in activity is place in the service.

I have only found lifecycle for Auto Scaling Group but no for Auto Scaling itself.

Does anyone know if this documentation exist? Does anyone know how ECS Service picks which task to stop when scaling in?

Thanks!

1

1 Answers

1
votes

Currently, there is no direct equivalent of EC2 lifecycles on ECS. There is a still open github issue about this:

From the issue it seams that the tasks are terminated at random:

Currently setting DesiredCount on the ECS Service seems to basically pick Tasks at random to kill.

As explained in the issue, if you want some sort of control over this process, it can be achieved through the the use stopTimeout option:

Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own.