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 40 discussion

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

When using a module block to reference a module stored on the public Terraform Module Registry such as:

How do you specify version 1.0.0?

  • A. Modules stored on the public Terraform Module Registry do not support versioning
  • B. Append ?ref=v1.0.0 argument to the source path
  • C. Add version = "1.0.0" attribute to module block
  • D. Nothing ג€" modules stored on the public Terraform Module Registry always default to version 1.0.0
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
amrith501
Highly Voted 2 years, 5 months ago
Selected Answer: C
C correct answer Version When using modules installed from a module registry, we recommend explicitly constraining the acceptable version numbers to avoid unexpected or unwanted changes. Use the version argument in the module block to specify versions: module "consul" { source = "hashicorp/consul/aws" version = "0.0.5" servers = 3 }
upvoted 17 times
...
enook
Most Recent 10 months, 3 weeks ago
Selected Answer: C
CCCCCC
upvoted 1 times
...
Bere
1 year, 3 months ago
Selected Answer: C
Example: module "consul" { source = "hashicorp/consul/aws" version = "1.0.0" // other necessary arguments... }
upvoted 2 times
...
foreverlearner
1 year, 4 months ago
Selected Answer: C
Although please note that version is now deprecated in favour of the required_providers block https://developer.hashicorp.com/terraform/language/providers/configuration#version-deprecated
upvoted 4 times
foreverlearner
1 year, 4 months ago
Ok sorry my bad this is a module not a provider so that's not relevant (but still good to know though :) ) Answer is still C
upvoted 1 times
...
...
Ni33
1 year, 6 months ago
Selected Answer: C
C is the correct answer. It is used to lock down version of the modules in production grade infrastructure templates.
upvoted 1 times
...
Power123
1 year, 7 months ago
C is correct
upvoted 1 times
...
sahara99
1 year, 9 months ago
Selected Answer: C
example from HashiCorp: module "consul" { source = "hashicorp/consul/aws" version = "0.0.5" servers = 3 }
upvoted 2 times
...
aleksand41
2 years, 1 month ago
Selected Answer: C
C is correct
upvoted 2 times
...
Eltooth
2 years, 5 months ago
Selected Answer: C
C is correct answer. The version argument accepts a version constraint string. Terraform will use the newest installed version of the module that meets the constraint; if no acceptable versions are installed, it will download the newest version that meets the constraint. Version constraints are supported only for modules installed from a module registry, such as the public Terraform Registry or Terraform Cloud's private module registry. Other module sources can provide their own versioning mechanisms within the source string itself, or might not support versions at all. In particular, modules sourced from local file paths do not support version; since they're loaded from the same source repository, they always share the same version as their caller. https://www.terraform.io/language/modules/syntax#version
upvoted 3 times
...
elvancedonzy
2 years, 5 months ago
Selected Answer: C
C is correct https://www.terraform.io/language/modules/syntax
upvoted 3 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 ...