HashiCorp Certified: Terraform Associate — Question 350
What happens when you execute terraform plan?
Answer options
- A. Imports all of your existing cloud provider resources to the state.
- B. Installs all providers and modules referenced by configuration.
- C. 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.
- D. Refreshes your state, then compares your state file to your Terraform configuration and creates an execution plan if any changes need to be made.
Correct answer: D
Explanation
The correct answer, D, describes the process where terraform plan refreshes the state and compares it to the configuration to identify required changes. Options A and B are incorrect as they describe actions that are not performed by the terraform plan command. Option C, while similar, does not mention the refresh action that D correctly includes.