Undeploy (remove) stacks marked as obsolete within the given command path.
Takomo also removes obsolete stacks that depend on the obsolete stacks within the command path, even if they are outside the given command path. Takomo arranges the stacks in removal order by stack dependencies, ensuring that it removes the stacks in the correct order and in parallel when possible.
Obsolete stacks can't have dependent stacks that are not obsolete themselves.
tkm stacks prune [command-path] \
- Command path to select which stacks to prune.
- Optional, by default, Takomo prunes all stacks.
- Ignore stack dependencies. By default, when a stack is removed, its dependants are removed first, and then the stack itself. In some exceptional cases, you might want to remove just one stack and skip its dependants.
- Bear in mind that this option is supported only when exactly one stack is removed. Ignoring dependants may lead into unexpected results, so you should use this option only in exceptional circumstances.
- Choose the command path using autocompleting search.
- Print the command result using this format
- Supported values:
These are the minimum IAM permissions required to run this command.
# Minimum permissions. Additional permissions are needed to actually
# remove the resources defined in CloudFormation templates.
- Sid: Stacks
# IAM permissions needed only if command roles are used
# Specify resource to restrict access to specific roles.
- Sid: IAM
Prune all stacks:
tkm stacks prune
Prune stacks within the given command path:
tkm stacks prune /dev
Prune only /dev/vpc.yml stack and its dependants:
tkm stacks prune /dev/vpc.yml
The region part must be specified if the stack has more than one region and you want to prune it from only one region.
tkm stacks prune /dev/vpc.yml/eu-west-1
Prune exactly one stack and skip its dependants:
tkm stacks prune /cloudtrail.yml --ignore-dependencies