Skip to content

Instantly share code, notes, and snippets.

@mjaromi
Created September 23, 2020 11:30
Show Gist options
  • Save mjaromi/5e3de869a5dca9e584adc7e4cafb0461 to your computer and use it in GitHub Desktop.
Save mjaromi/5e3de869a5dca9e584adc7e4cafb0461 to your computer and use it in GitHub Desktop.
Show serviceName / placementConstraints.type/expression for ECS services running on $ECS_CLUSTER_NAME cluster
aws ecs list-services --cluster $ECS_CLUSTER_NAME | jq -r '.serviceArns[]' | while read service ; do
aws ecs describe-services --services $service --cluster $ECS_CLUSTER_NAME | jq -r '.services[] | "\(.serviceName) - \(.placementConstraints[].type) - \(.placementConstraints[].expression)"'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment