snippetbashTip
tofu plan — Generate and show OpenTofu execution plans. More information: <https://opentofu.org/docs/cli/command
Viewed 0 times
commandtofu planshowandcliexecutiongenerateopentofu
Problem
How to use the
tofu plan command: Generate and show OpenTofu execution plans. More information: <https://opentofu.org/docs/cli/commands/plan/>.Solution
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 planShow a plan to destroy all remote objects that currently exist:
tofu plan -destroyShow a plan to update the Tofu state and output values:
tofu plan -refresh-onlySpecify 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 -jsonWrite a plan to a specific file:
tofu plan -no-color > {{path/to/file}}Code Snippets
Generate and show the execution plan in the currently directory
tofu planShow a plan to destroy all remote objects that currently exist
tofu plan -destroyShow a plan to update the Tofu state and output values
tofu plan -refresh-onlySpecify 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]}}Context
tldr-pages: common/tofu plan
Revisions (0)
No revisions yet.