Do we have aws cli command to wait for ecs service update to start new task?

Viewed 450

I am using below aws cli command to update my service in ecs with new task definition from Jenkins job. aws ecs update-service --cluster xyz --service abc --task-definition=abc.json --force-new-deployment

This command is updating the service and starting new deployment (creating new task)

Now, I am looking for aws cli command or a way for my Jenkins job to wait until the newly created task is in RUNNING state.

I have tried to do list-tasks but not sure how to get the latest task to describe and pull status.

1 Answers

You can try aws ecs wait services-stable (documentation here) which will wait for new tasks to be running, and old tasks to be stopped.

Related