bash-my-aws / bash-my-aws

Bash-my-AWS provides simple but powerful CLI commands for managing AWS resources

Home Page:https://bash-my-aws.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ECS support

nitrocode opened this issue Β· comments

Helpful project. πŸ˜„

I use ECS a lot and would like to see it supported here if time permits. Here's an example of getting the currently running task definition that I found useful.

export clusterName=
export service=
# get current task definition of running task in service in cluster
export taskDef=$(aws ecs \
  describe-services \
  --cluster $clusterName \
  --services $service \
  --query 'services[].deployments[].taskDefinition | [0]' \
  --output text | \
  cut -d'/' -f2)
echo $taskDef
# get current task definition
aws ecs \
  describe-task-definition \
  --task-definition $taskDef \
  --query taskDefinition.taskRoleArn \
  --output text

No current plans to add ECS but you can always write it for yourself