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 | |
clusters=$(aws ecs list-clusters --query 'clusterArns' --output text) | |
total_tasks=0 | |
for cluster in $clusters; do | |
task_count=$(aws ecs list-tasks --cluster $cluster --query 'length(taskArns[])') | |
total_tasks=$((total_tasks + task_count)) | |
done | |
echo "Total ECS tasks in all clusters in the account, region: $total_tasks" |
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 | |
# Count ACI containers | |
RESOURCE_GROUP="" | |
TOTAL_CONTAINERS=0 | |
CONTAINER_COUNT=0 | |
echo "\$CONTAINER_RESOURCEGROUP | \$CONTAINER_NAME | \$CONTAINER_COUNT" | |
while IFS=$'\t' read -r CONTAINER_NAME CONTAINER_RESOURCEGROUP ; do |
OlderNewer