Previewing changes

The next step is the preview of the changes made to the infrastructure before applying them.

For this, run Terraform with the plan command and, when executed, the plan automatically uses the terraform.tfvars file to set the variables.

To execute it, launch the plan command:

terraform plan

The following output shows the execution of the terraform plan command:

During the execution of the plan command, the command displays the name and properties of the resources that will be impacted by the change, with also the number of new resources and the number of resources that will be modified, as well as the number of resources that will be deleted.

For more information about the plan command line, see the documentation: https://www.terraform.io/docs/commands/plan.html.

We have, therefore, just predicted the changes that will be applied to our infrastructure; we will now see how to apply them.