I am using CircleCI for my CI/CD along with CodeDeploy. I would like to run an ecs run-task
command and would like the task to complete before moving on to the more intricate deployment stages, which we use CodeDeploy for, and is triggered through the CircleCI config. In a previous version of the aws cli the --wait
flag was an option for this, but is not an option in aws version 2+. Are there any other simple alternatives that people are using to get around this?
Question posted in Amazon Web Sevices
The official Amazon Web Services documentation can be found here.
The official Amazon Web Services documentation can be found here.
2
Answers
Adding my solution here thanks to Mark B's response.
You would use the
aws ecs wait
capability in the CLI. Note that this is the same in version 1 of the CLI and version 2, there was never a--wait
for ECS tasks in the core AWS CLI as far as I’m aware.Specifically, after starting the task and getting the task ID returned from the
run-task
command, you would useaws ecs wait task-stopped --tasks <task-id>
to wait for the task to be done/stopped.