Skip to content

Instantly share code, notes, and snippets.

View mpozniak's full-sized avatar
👽

Mikhail mpozniak

👽
View GitHub Profile
@hakanilter
hakanilter / ecs-run-and-wait.sh
Last active December 7, 2023 16:50
AWS ECS run task and wait for the result
# Requies JSON as the output format and "jq" commandline tool
# If task runs successfuly, exits 0
run_result=$(aws ecs run-task \
--cluster ${CLUSTER} \
--task-definition ${TASK_DEFINITION} \
--launch-type EC2 \
--overrides "${OVERRIDES}")
echo ${run_result}
container_arn=$(echo $run_result | jq -r '.tasks[0].taskArn')
aws ecs wait tasks-stopped \