Search code examples
dockeramazon-ecsrolling-updates

forcing the stop before the start of the containers during rolling update on aws ecs


is there a way to port the following docker compose configuration from ecs console?

deploy:
  update_config:
    parallelism: 2
    delay: 10s
    order: stop-first

i'm interested in forcing the order option, one of the container in the ecs task must be stopped before creating a new one during the rolling updates


Solution

  • If one of the containers in the task must be stopped before another instance can be created, then in ECS the entire task will have to be stopped before another instance of the task is created.

    In ECS you would control this via the DeploymentConfiguration options on the ECS service. You would need to set the maximumPercent and minimumHealthyPercent values such that you never get more than your intended number of tasks at any time.

    For example if you want a maximum of 2 instances of the task to be running, you would set the desired task count to 2 in the service's auto-scaling configuration, and set maximumPercent to 100 and minimumHealthyPercent to 50.