Search code examples
amazon-web-servicesamazon-ec2amazon-ecs

How to restart containers in AWS ECS?


I have provided application configuration via consul's key-value store to the application containers running in ECS services.

The application reads its configuration from consul only once on start up.

When I need to change the configuration, how should I go about restarting the containers so that the application configuration is refreshed?

I am hoping to do this programmatically via the aws cli.


Solution

  • You don't restart containers. You can however stop the individual tasks, and ECS will respawn another instance of your task somewhere on the cluster.