mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-21 02:37:43 -05:00
Signed-off-by: Janos <86970079+janosdebugs@users.noreply.github.com> Signed-off-by: Damian Stasik <920747+damianstasik@users.noreply.github.com> Signed-off-by: Roman Grinovski <roman.grinovski@gmail.com> Co-authored-by: Damian Stasik <920747+damianstasik@users.noreply.github.com> Co-authored-by: Roman Grinovski <roman.grinovski@gmail.com>
42 lines
1.2 KiB
Plaintext
42 lines
1.2 KiB
Plaintext
---
|
|
description: >-
|
|
The tofu destroy command destroys all objects managed by a OpenTofu
|
|
configuration.
|
|
---
|
|
|
|
# Command: destroy
|
|
|
|
The `tofu destroy` command is a convenient way to destroy all remote
|
|
objects managed by a particular OpenTofu configuration.
|
|
|
|
While you will typically not want to destroy long-lived objects in a production
|
|
environment, OpenTofu is sometimes used to manage ephemeral infrastructure
|
|
for development purposes, in which case you can use `tofu destroy` to
|
|
conveniently clean up all of those temporary objects once you are finished
|
|
with your work.
|
|
|
|
## Usage
|
|
|
|
Usage: `tofu destroy [options]`
|
|
|
|
This command is just a convenience alias for the following command:
|
|
|
|
```
|
|
tofu apply -destroy
|
|
```
|
|
|
|
For that reason, this command accepts most of the options that
|
|
[`tofu apply`](../commands/apply.mdx) accepts, although it does
|
|
not accept a plan file argument and forces the selection of the "destroy"
|
|
planning mode.
|
|
|
|
You can also create a speculative destroy plan, to see what the effect of
|
|
destroying would be, by running the following command:
|
|
|
|
```
|
|
tofu plan -destroy
|
|
```
|
|
|
|
This will run [`tofu plan`](plan.mdx) in _destroy_ mode, showing
|
|
you the proposed destroy changes without executing them.
|