LinuxCommandLibrary

terraform-plan

Preview Terraform infrastructure changes

TLDR

Create execution plan

$ terraform plan
copy
Save plan to file
$ terraform plan -out=[plan.tfplan]
copy
Plan with variable
$ terraform plan -var="[key]=[value]"
copy
Plan destroy
$ terraform plan -destroy
copy
Plan specific target
$ terraform plan -target=[resource]
copy

SYNOPSIS

terraform plan [options]

DESCRIPTION

terraform plan creates an execution plan showing proposed changes. Compares current state with configuration. Review before applying to understand infrastructure changes.

PARAMETERS

-out file

Save plan to file.
-var name=value
Set variable.
-var-file file
Variable file.
-target resource
Target specific resource.
-destroy
Plan destruction.
-refresh-only
Only refresh state.
-detailed-exitcode
Exit 2 if changes planned.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community