A cloud engineer has prepared a set of Terraform configuration files to provision Google Cloud infrastructure. Before applying any changes to the environment, the engineer wants to preview the execution plan and verify which resources will be created or modified. Which command should the cloud engineer run?
- terraform planAnswer
- Bterraform apply --preview
- Cterraform init --dry-run
- Dgcloud deployment-manager deployments preview
Answer
The command 'terraform plan' should be run to preview resource changes before applying them.
Executing 'terraform plan' parses the local configuration files, compares them against the current Terraform state file and live GCP infrastructure, and outputs the detailed set of additions, modifications, or deletions that would occur upon deployment without altering any resources.
Step-by-Step Solution
Key Concept
Terraform Execution Plan Generation
Estimated Time:45s