Docker – How to restart all Tasks of a Service

amazon-ecsamazon-web-servicesdocker

We have a task that loads some configuration files from an external data source. After the settings are uploaded we would like to be able to restart all the tasks in a service so that the settings propagate to all instances.

What's the best way to restart all services?

We have a 'workaround' that involves setting the 'number of tasks' to 0 and then back up, but this is definitely not how it's supposed to be done and has downtime.

Best Answer

Using the AWS CLI tool:

aws ecs update-service --force-new-deployment --service my-service --cluster cluster-name