Ad space (banner)
AD

Got the fundamentals? A structured Terraform course is a fast way to level up.

Find Terraform courses on Udemy

Affiliate link. Costs you nothing extra.

Lesson 25 / 37

Saving a Plan with terraform plan -out

When you want the thing you apply to be exactly the thing you reviewed, save the plan with -out.

The syntax is terraform plan -out=filename. The file records the precise set of actions.

Running terraform plan -out=tfplan writes the plan to tfplan, which can then be applied later without recomputing it.

A common stumble is committing the plan file. It can contain sensitive values and is only meaningful for a short window.

In real work, CI produces a saved plan, a human approves it, and that same file is applied — so nothing can change between review and execution.

Terraform
Try it (type this into the pseudo terminal)
terraform plan -out=tfplan

🧑‍💻 You can type this command into the Terraform pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)