Created
April 13, 2018 07:51
-
-
Save eekfonky/c9c99a3b43bc09aa54513d2d39c5968b to your computer and use it in GitHub Desktop.
EC2 Task Status
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
region="eu-west-1" | |
cluster="<CLUSTER_NAME>" | |
## Get Task names from Cluster | |
task_status () { | |
echo "Task Name and Status:" | |
mapfile -t tasksInCluster < <(aws ecs list-tasks --region $region --cluster $cluster | jq -r '.taskArns[]') | |
for task in "${tasksInCluster[@]}"; do | |
aws ecs describe-tasks --region $region --cluster $cluster --tasks $task | jq -r '.tasks[].containers[] | .name + " " + .lastStatus' | |
done | |
} | |
task_status |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment