TA-002-P · Question #381
As a developer, you want to ensure your plugins are up to date with the latest versions. Which Terraform command should you use?
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.
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
How the community answered
(24 responses)- A8% (2)
- B4% (1)
- D88% (21)
Why each option
To update Terraform provider plugins to their latest compatible versions, the `terraform init -upgrade` command should be used.
There is no standard terraform providers-upgrade command.
terraform apply applies changes to infrastructure and does not handle updating provider plugins.
terraform refresh updates the state file to reflect the real-world infrastructure but does not upgrade provider plugins.
The terraform init -upgrade command checks for and downloads the latest available versions of provider plugins configured in the Terraform code, ensuring that plugins are up-to-date within the specified version constraints. This command is responsible for initializing the working directory, which includes managing plugins.
Concept tested: Terraform plugin update command
Source: https://developer.hashicorp.com/terraform/cli/commands/init
Topics
Community Discussion
No community discussion yet for this question.