HashiCorp Certified: Terraform Associate — Question 127
What does running a terraform plan do?
Answer options
- A. Imports all of your existing cloud provider resources to the state file
- B. Compares the state file to your Terraform code and determines if any changes need to be made
- C. Imports all of your existing cloud provider resources to your Terraform configuration file
- D. Compares your Terraform code and local state file to the remote state file in a cloud provider and determines if any changes need to be made
Correct answer: B
Explanation
The correct answer is B because running a terraform plan analyzes the existing state file and Terraform code to identify any required modifications. Options A and C incorrectly state that resources are imported, while D discusses a comparison with a remote state file, which is not the primary function of a terraform plan.