Created
May 18, 2018 07:04
-
-
Save kenzo0107/adadc860e85f8b136ad040c71d249a3d to your computer and use it in GitHub Desktop.
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/sh | |
PROFILE=$1 | |
TASK_DEFINITION=$2 | |
r=$(aws ecs --profile $PROFILE list-task-definitions --family-prefix $TASK_DEFINITION --query 'taskDefinitionArns[]') | |
echo $r | jq -r '.[]' | while read task | |
do | |
rev=$(echo $task | sed -e's|^.*task-definition\/\(.*\)$|\1|g') | |
aws ecs --profile $PROFILE deregister-task-definition --task-definition $rev | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment