Search code examples
amazon-web-servicesamazon-ec2deploymentweb-deploymentamazon-ecs

Ecs run vs ecs deploy


for example for a migrate task we do ecs run and for any long running service to deploy we do ecs deploy. Why so? What is basic fundamental difference between these two. Because ecs run doesnt give back the status of the task ran. (it always returns a non zero status code on running the service). So we have to do polling to get the status of the deployment. So why cant we use ecs deploy instead of ecs run because ecs deploy returns the status of the deployment also?


Solution

  • What is basic fundamental difference between these two.

    aws ecs run-tusks starts a single task, while aws ecs deploy deploys a new task definition to a service.

    Thus the different is that a single service can run many long-running tasks. Since you are running many tasks in a service you need to have a deployment strategy (e.g. rolling or blue/green) for how you deploy new versions of your task definitions.

    So the choice of which to use depends on your specific use cases. For ad-hoc short running jobs, a single task can be sufficient. For hosting business critical containers, a service is the right choice.