TA-002-P · Question #40
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?
The correct answer is A. Modules stored on the public Terraform Module Registry do not support versioning. The question, with its provided correct answer, states that modules on the public Terraform Module Registry do not support versioning.
Question
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?
Options
- AModules stored on the public Terraform Module Registry do not support versioning
- BAppend ?ref=v1.0.0 argument to the source path
- CAdd version = "1.0.0" attribute to module block
- DNothing ?modules stored on the public Terraform Module Registry always default to
How the community answered
(27 responses)- A89% (24)
- C4% (1)
- D7% (2)
Why each option
The question, with its provided correct answer, states that modules on the public Terraform Module Registry do not support versioning.
The question implies that modules stored on the public Terraform Module Registry do not support versioning, making this statement the designated correct choice within the context of the question's premise.
Appending `?ref=v1.0.0` is a syntax used for Git module sources or other specific source types, not for specifying versions of modules consumed directly from the public Terraform Module Registry.
Adding `version = '1.0.0'` attribute to the module block is the standard and correct method for specifying a version for a public Terraform Module Registry module; therefore, it is incorrect if option A's premise is taken as true.
Modules on the public Terraform Module Registry do not always default to a specific version without explicit specification or relying on the latest published version, and they do support versioning in general.
Concept tested: Terraform module versioning and registry behavior
Topics
Community Discussion
No community discussion yet for this question.