> ## Documentation Index
> Fetch the complete documentation index at: https://docs.formae.io/llms.txt
> Use this file to discover all available pages before exploring further.

# formae destroy

> Tear down resources from a forma file or a query. Reference for formae destroy and its flags.

Destroy the resources described by a forma, or select resources to destroy with a
query. Because a [stack](/documentation/concepts/stack) has referential integrity,
destroying one of its resources destroys the whole stack.

```bash theme={"languages":{"custom":["/languages/pkl.json"]}}
formae destroy [flags] [<forma file>]
```

Provide a forma file to destroy everything it defines, or use `--query` to select
resources by their attributes. The query is only used when no forma file is given.

## Examples

```bash theme={"languages":{"custom":["/languages/pkl.json"]}}
formae destroy forma.pkl
formae destroy --query 'stack:test-* managed:false'
formae destroy --query 'type:AWS::S3::Bucket stack:scratch' --yes
```

## Flags

| Flag                                         | Default   | Description                                                                                            |
| -------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------ |
| `--query <query>`                            |           | Find resources by their attributes. Only used when no forma file is provided. `*` works as a wildcard. |
| `--on-dependents <abort\|cascade>`           | `abort`   | Behavior when other resources depend on those being deleted.                                           |
| `--simulate`                                 | `false`   | Simulate the command rather than make actual changes.                                                  |
| `--status-output-layout <summary\|detailed>` | `summary` | What to print as status output.                                                                        |
| `--yes`                                      | `false`   | Run without any confirmations.                                                                         |
| `--output-consumer <human\|machine>`         | `human`   | Consumer of the command result.                                                                        |
| `--output-schema <json\|yaml>`               | `json`    | The schema to use for the result output.                                                               |
| `--config <path>`                            |           | Path to a config file.                                                                                 |
| `--profile <name>`                           |           | Named profile to use.                                                                                  |
