destroy command
This command enables the destruction of all resources either included in the provided forma, or found through the provided query. The command immediately returns a command ID, which should be used to query the progress of the operation later using the status command, unless --watch
is set, in which case the command keeps outputting the status directly.
Usage
formae destroy [OPTIONS] <forma file>
Options
Option | Description |
---|---|
--output-consumer |
Consumer of the command result (human | machine) [default: "human"] |
--output-schema |
The schema to use for the result output (json | yaml) [default: "json"] |
--query |
Query that allows to find resources by their attributes. Only applies if no forma file is provided [default: " "] |
--simulate |
Simulate the command rather than make actual changes [default: "false"] |
--status-output-layout |
What to print as status output (summary | detailed) [default: "summary"] |
--yes |
Allow the command to run without any confirmations [default: "false"] |
--watch |
Watch mode: continuously refresh the status until completion [default: "false"] |
Consumer
Currently, there are two consumers:
- human (default): The CLI assumes a human user is interacting with it. Output is less strictly formatted and more verbose
- machine: The CLI assumes the data printed to stdout will be processed by a machine or another tool
Query
This command, using the --query
flag, allows you to search and destroy resources managed by formae. The query language is simple and is described in detail here.
Following fields are available for search:
stack
: the stack that the to-be-destroyed resources need to belong tolabel
: the label of the resource (case sensitive)type
: the type of the resource (case insensitive)
Here are a few examples:
formae destroy --query='stack:foobar'
: destroy all currently managed resources from the stackfoobar
formae destroy --query='-stack:foobar'
: destroy all currently managed resources from any stack other thanfoobar
formae status --query='type:aws::ec2::subnet'
: destroy all currently managed resources of typesubnet
Simulation
The destroy command can be fully simulated. The result will be a dry run outputting all changes that would be made if the command would run for real.