Skip to content

Instantly share code, notes, and snippets.

@Cayan
Created June 27, 2018 13:20
Show Gist options
  • Save Cayan/b84bb55d1f20b233eb61f21459cc4e3e to your computer and use it in GitHub Desktop.
Save Cayan/b84bb55d1f20b233eb61f21459cc4e3e to your computer and use it in GitHub Desktop.
Script to delete all ECS task definitions according to a pattern
# run `aws ecs list-task-definitions --status active` to list all available task definitions
aws ecs list-task-definitions --status active | grep REPLACE_WITH_THE_NAME_OF_DEFINITION |
awk '{print substr($0, 1, length($0)-1)}' | xargs -I{} aws ecs deregister-task-definition --task-definition {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment