nerdexam
HashiCorp

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.

Interact with Terraform modules

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)
  • A
    89% (24)
  • C
    4% (1)
  • D
    7% (2)

Why each option

The question, with its provided correct answer, states that modules on the public Terraform Module Registry do not support versioning.

AModules stored on the public Terraform Module Registry do not support versioningCorrect

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.

BAppend ?ref=v1.0.0 argument to the source path

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.

CAdd version = "1.0.0" attribute to module block

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.

DNothing ?modules stored on the public Terraform Module Registry always default to

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

#Terraform Modules#Module Registry#Module Versioning#Module Source

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice