nerdexam
HashiCorp

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…

Submitted by andres_qro· Apr 18, 2026Use Terraform CLI

Question

You just upgraded the version of a provider in an existing Terraform project. What do you need to do to install the new provider?

Options

  • ARun terraform refresh.
  • BRun terraform init -upgrade.
  • CRun terraform apply -upgrade.
  • DUpgrade your version of Terraform.

How the community answered

(47 responses)
  • A
    4% (2)
  • B
    87% (41)
  • C
    2% (1)
  • D
    6% (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

#Terraform CLI#Provider management#terraform init#Provider versions

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 Practice