Plan Command

Learn how to use Terraform plans with the Terraform plan command

Terraform plan command

Until now, we have been taking advantage of the fact that the command terraform apply does a plan first and pauses for you to confirm by default. It is, however, possible to get Terraform to do a plan without the option of applying it. To do this, run the command terraform plan.

A Terraform plan command will produce a plan as we have seen before, but will not give you the option to apply it. Instead, it will simply show you the plan. This command can be useful if you want to test something but do not want to run the risk of applying it by accident. It can also be useful when building Terraform deployment pipelines, as we will discuss below.

Get hands-on with 1400+ tech skills courses.