nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-003 · 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…

Navigate Terraform workflow

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

(64 responses)
  • A
    3% (2)
  • B
    78% (50)
  • C
    6% (4)
  • D
    13% (8)

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 init#provider upgrade#version management

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-003 Practice