HashiCorp Certified: Terraform Associate — Question 305
You just upgraded the version of a provider in an existing Terraform project. What do you need to do to install the new provider?
Answer options
- A. Run terraform apply -upgrade
- B. Run terraform init -upgrade
- C. Run terraform refresh
- D. Upgrade your version of Terraform
Correct answer: B
Explanation
The correct answer is B, as the command 'terraform init -upgrade' is specifically designed to install the updated provider version along with other module updates. Option A is incorrect because 'terraform apply -upgrade' does not handle provider installations. Option C, 'terraform refresh', only updates the state file without installing new providers. Option D, upgrading Terraform itself, is not necessary for installing the new provider version.