aws-nuke
aws-nuke copied to clipboard
Nuke ECS services and task-definition based on tags
This is similar to the general question of using tags to filter all resources but may be a simpler and maybe more pressing use case.
ECS services and tasks may come and go quickly and maybe also have unpredictable names so using tags to identify them and exclude them from aws-nuke run would be beneficial.
Perhaps more annoyingly tho, the AWS api don't seem to return the tags by default.
aws ecs describe-services --cluster lizard --services lexx | jq 'del(.services[0].events) | .services[0].tags'
returns nothing
aws ecs describe-services --cluster lizard --services lexx --include TAGS | jq 'del(.services[0].events) | .services[0].tags'
[
{
"key": "Parallel Universe",
"value": "1"
}
]