Correct: "Use the -upgrade option if you want Terraform to ignore the dependency lock file and consider installing newer versions."
https://developer.hashicorp.com/terraform/cli/commands/init#plugin-installation
Wrong. The command you used is to override the lock file's current version, installing the latest version, and the version tracked in the lock file will be ignored.
If a particular provider already has a selection recorded in the lock file, Terraform will always re-select that version for installation, even if a newer version has become available. You can override that behavior by adding the -upgrade option when you run terraform init, in which case Terraform will disregard the existing selections and once again select the newest available version matching the version constraint.
Tested in lab
Answer is A
If a particular provider already has a selection recorded in the lock file, Terraform will always re-select that version for installation, even if a newer version has become available.
You can override that behavior by adding the -upgrade option when you run terraform init, in which case Terraform will disregard the existing selections and once again select the newest available version matching the version constraint.
https://developer.hashicorp.com/terraform/language/files/dependency-lock#dependency-installation-behavior:~:text=Terraform%20will%20always%20re%2Dselect%20that%20version%20for%20installation%2C%20even%20if%20a%20newer%20version%20has%20become%20available
While I chose B (false), the question is not clear. Reason , it will not automatically update the version with terraform init, but there is an option -upgrade that needs to be added (terraform init -upgrade). Not sure if the exam has an implicit assumption that you run `terraform init ` with -upgrade option and if so the answer would be true.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
tom_cat
Highly Voted 1 year, 5 months agoDevoteamAnalytix
1 year, 4 months agoshanx910
1 year ago090200f
3 months, 2 weeks agoMattt
Most Recent 2 months agoNewuser95
9 months agoshanx910
1 year agoVSMu
1 year, 4 months agoMarch2023
1 year, 5 months ago