nerdexam
HashiCorp

TA-002-P · Question #378

Module version is required to reference a module on the Terraform Module Registry.

The correct answer is B. False. While highly recommended for stability and reproducibility, specifying a module version is not strictly mandatory for referencing a module from the Terraform Module Registry.

Interact with Terraform modules

Question

Module version is required to reference a module on the Terraform Module Registry.

Options

  • ATrue
  • BFalse

How the community answered

(33 responses)
  • A
    12% (4)
  • B
    88% (29)

Why each option

While highly recommended for stability and reproducibility, specifying a module version is not strictly mandatory for referencing a module from the Terraform Module Registry.

ATrue

This statement is false because Terraform will implicitly use the latest version if no version is specified, though this is not a best practice.

BFalseCorrect

While it is strongly recommended to specify a version constraint when referencing a module from the Terraform Module Registry for stability and reproducibility, Terraform will use the latest available version if no version argument is provided. However, this practice is discouraged because it can lead to unexpected changes if the module author publishes breaking changes.

Concept tested: Terraform module versioning

Source: https://developer.hashicorp.com/terraform/language/modules/sources#module-versions

Topics

#Terraform Modules#Module Registry#Module Versioning#Module Referencing

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice