TERRAFORM-ASSOCIATE-004 · Question #216
You just upgraded the version of a provider in an existing Terraform project. What do you need to do to install the new provider?
The correct answer is B. Run terraform init -upgrade. When upgrading a provider, you must run terraform init -upgrade to install the new version. This downloads the latest provider version and updates the local dependency cache. terraform refresh (A) only updates the state file but does not upgrade providers. terraform apply…
Question
Options
- ARun terraform refresh.
- BRun terraform init -upgrade.
- CRun terraform apply -upgrade.
- DUpgrade your version of Terraform.
How the community answered
(47 responses)- A4% (2)
- B87% (41)
- C2% (1)
- D6% (3)
Explanation
When upgrading a provider, you must run terraform init -upgrade to install the new version. This downloads the latest provider version and updates the local dependency cache. terraform refresh (A) only updates the state file but does not upgrade providers. terraform apply -upgrade (C) is not a valid command. terraform version can be upgraded separately, but (D) does not install a new provider version.
Topics
Community Discussion
No community discussion yet for this question.