nerdexam
HashiCorpHashiCorp

TA-002-P · Question #381

TA-002-P Question #381: Real Exam Question with Answer & Explanation

The correct answer is D: terreformn lnit -upgrade. To update Terraform provider plugins to their latest compatible versions, the terraform init -upgrade command should be used.

Use the Terraform CLI (terraform plan, apply, destroy, fmt, init, validate, workspace, import, taint, providers, output)

Question

As a developer, you want to ensure your plugins are up to date with the latest versions. Which Terraform command should you use?

Options

  • Aterreform providers- upgrade
  • Bterreform apply -upgrade
  • Cterreform refresh -upgrade
  • Dterreformn lnit -upgrade

Explanation

To update Terraform provider plugins to their latest compatible versions, the terraform init -upgrade command should be used.

Common mistakes.

  • A. There is no standard terraform providers-upgrade command.
  • B. terraform apply applies changes to infrastructure and does not handle updating provider plugins.
  • C. terraform refresh updates the state file to reflect the real-world infrastructure but does not upgrade provider plugins.

Concept tested. Terraform plugin update command

Reference. https://developer.hashicorp.com/terraform/cli/commands/init

Topics

#Terraform CLI#terraform init#Plugin updates#Provider management

Community Discussion

No community discussion yet for this question.

Full TA-002-P PracticeBrowse All TA-002-P Questions