Created
March 2, 2020 23:10
-
-
Save leandrosiow/f5e9f81933902245aeb8e4b8f108c080 to your computer and use it in GitHub Desktop.
This script simply displays the capacity provider in a ECS Cluster
This file contains 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 | |
CLUSTER=ecs-fargate-spot-only | |
ECS_SERVICE_NAME=ecs-fargate-hybrid | |
TASK_ARNS=$(aws ecs list-tasks --cluster $CLUSTER --service-name $ECS_SERVICE_NAME) | |
TASK_ARNS_STRING=$(echo $TASK_ARNS | jq --raw-output .taskArns[]) | |
# echo $TASK_ARNS_STRING | |
# aws ecs describe-tasks --cluster ecs-fargate-spot-only --tasks $TASK_ARNS_STRING | grep capacityProviderName | |
# This line is working | |
aws ecs describe-tasks --cluster $CLUSTER --tasks $TASK_ARNS_STRING | jq '.tasks[] | .capacityProviderName' | |
#This line is working too | |
# aws ecs describe-tasks --cluster ecs-fargate-spot-only --tasks $TASK_ARNS_STRING | jq '.tasks[] | [.capacityProviderName, .taskArn]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment