AWS › Amazon ECS (Elastic Container Service)
How does an ECS service maintain the desired number of running tasks?
IntermediateAnswer
An ECS service continuously monitors the number of running tasks against a desired count you specify, automatically launching replacement tasks if any fail or are stopped unexpectedly, and it can also integrate with an Application Load Balancer to distribute incoming traffic evenly across all healthy running tasks.
aws ecs update-service --cluster my-cluster --service my-service --desired-count 4Real-world example An e commerce application configures its ECS service to always maintain four running tasks, so if one container crashes due to an unexpected error, ECS automatically starts a replacement without any manual intervention.