Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Terraform Associate All Questions

View all questions & answers for the Terraform Associate exam

Exam Terraform Associate topic 1 question 256 discussion

Actual exam question from HashiCorp's Terraform Associate
Question #: 256
Topic #: 1
[All Terraform Associate Questions]

You add a new resource to an existing Terraform configuration, but do not update the version constraint in the configuration. The existing and new resources use the same provider. The working directory contains a .terraform-lock.hcl file.

How will Terraform choose which version of the provider to use?

  • A. Terraform will use the latest version of the provider for the new resource and the version recorded in the lock file to manage existing resources
  • B. Terraform will use the version recorded in your lock file
  • C. Terraform will check your state file to determine the provider version to use
  • D. Terraform will use the latest version of the provider available at the time you provision your new resource
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
DevoteamAnalytix
1 year, 5 months ago
Selected Answer: B
https://developer.hashicorp.com/terraform/language/files/dependency-lock#dependency-installation-behavior
upvoted 3 times
...
Foram31
1 year, 5 months ago
Selected Answer: B
When Terraform encounters a new resource that uses the same provider, it will consult the .terraform-lock.hcl file to determine the version of the provider to use for that resource. This ensures consistency in the versions used across resources in the configuration and helps maintain reproducibility.
upvoted 3 times
...
simoziyadi
1 year, 5 months ago
B is correct
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
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.

SaveCancel
Loading ...