Created
June 30, 2021 19:04
-
-
Save ianchesal/5afbceae4ebbc1a1fffd51394260e613 to your computer and use it in GitHub Desktop.
List fargate content in ECS clusters
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 | |
# Returns the count of Fargate content in each ECS cluster in your account+region. | |
aws ecs list-clusters 2>/dev/null | jq -c '.clusterArns[]' | while read cluster; do | |
cluster="${cluster%\"}" | |
cluster="${cluster#\"}" | |
cname=$(basename $cluster) | |
echo "Checking: $cname" | |
aws ecs list-services --cluster $cname --launch-type FARGATE 2>/dev/null | jq '.serviceArns | length' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment