1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-21 22:22:07 +02:00
tldr/pages/common/tofu-plan.md
Coba b2854347d2
tofu: add page (#16031)
Co-authored-by: K.B.Dharun Krishna <kbdharunkrishna@gmail.com>
2025-03-27 23:50:19 +02:00

740 B

tofu plan

Generate and show OpenTofu execution plans. More information: https://opentofu.org/docs/cli/commands/plan/.

  • Generate and show the execution plan in the currently directory:

tofu plan

  • Show a plan to destroy all remote objects that currently exist:

tofu plan -destroy

  • Show a plan to update the Tofu state and output values:

tofu plan -refresh-only

  • Specify values for input variables:

tofu plan -var '{{name1}}={{value1}}' -var '{{name2}}={{value2}}'

  • Focus Tofu's attention on only a subset of resources:

tofu plan -target {{resource_type.resource_name[instance index]}}

  • Output a plan as JSON:

tofu plan -json

  • Write a plan to a specific file:

tofu plan -no-color > {{path/to/file}}