Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenzo0107/adadc860e85f8b136ad040c71d249a3d to your computer and use it in GitHub Desktop.
Save kenzo0107/adadc860e85f8b136ad040c71d249a3d to your computer and use it in GitHub Desktop.
#!/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