Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.