TA-002-P · Question #436
How do you specify a module's version when publishing it to the public Terraform Module Registry?
The correct answer is C. The release tags in the associated repo. When publishing to the Public Terraform Module Registry, module versions are automatically determined by the Git release tags (e.g., v1.0.0) found in the associated source code repository.
Question
How do you specify a module's version when publishing it to the public Terraform Module Registry?
Options
- AThe module's configuration page on the Terraform Module Registry
- BTerraform Module Registry does not support versioning modules
- CThe release tags in the associated repo
- DThe module's Terraform code
How the community answered
(32 responses)- A6% (2)
- B3% (1)
- C88% (28)
- D3% (1)
Why each option
When publishing to the Public Terraform Module Registry, module versions are automatically determined by the Git release tags (e.g., `v1.0.0`) found in the associated source code repository.
While there might be a configuration page for a module, the version itself is not manually specified there; it is derived directly from the Git repository's tags.
Terraform Module Registry absolutely supports versioning modules; it is a fundamental feature that allows users to specify and rely on particular module versions.
The Public Terraform Module Registry automatically detects and lists module versions based on Git release tags (e.g., `v1.0.0`, `v1.0.1`) found in the module's linked source code repository.
The module's Terraform code itself does not contain metadata for its overall version number as published to the registry; versioning is managed at the repository level via Git tags.
Concept tested: Terraform Module Registry versioning
Source: https://developer.hashicorp.com/terraform/registry/modules/publish#module-versions
Topics
Community Discussion
No community discussion yet for this question.