Terraform-Associate-004 practice question 20 of 35

Which method for sharing Terraform modules fulfills the following criteria: Keeps the module configurations confidential within your organization. Supports Terraform's semantic version constraints. Provides a browsable directory of your modules.

Full set: 360 questions
Answer options
A: A Git repository containing your modules.
B: Public Terraform module registry.
C: A subfolder within your workspace.
D: HCP Terraform/Terraform Cloud private registry. Correct answer
Correct Answer:
D. HCP Terraform/Terraform Cloud private registry.
Explanation

HCP Terraform and Terraform Enterprise provide a private module registry specifically designed for internal, organizational use. This feature directly addresses all the requirements. It ensures confidentiality by restricting access to members of the organization. It fully supports semantic versioning by publishing modules from version control system (VCS) tags, allowing consumers to use version constraints in their configurations. Finally, it offers a user-friendly, browsable, and searchable web interface, making modules easily discoverable by teams within the organization.

Why Incorrect

A. A Git repository containing your modules. While private Git repositories ensure confidentiality and support versioning via tags, they lack a purpose-built, browsable directory for discovering and documenting modules like a dedicated registry provides.
B. Public Terraform module registry. This option fails the confidentiality requirement, as any module published to the public registry is accessible to everyone on the internet.
C. A subfolder within your workspace. Using a local path is confidential but does not support version constraints. It is also not a shared, browsable directory for the entire organization.

References

1. HashiCorp Terraform Documentation, "Private Registry": "The private module registry is a feature of HCP Terraform and Terraform Enterprise. It allows you to share Terraform modules privately within your organization... You can browse available modules on the Modules page of your organization's settings." This source confirms the confidentiality and browsable directory features.

2. HashiCorp Terraform Documentation, "Module Sources - Terraform Registry": "Terraform can fetch modules from a public or private module registry... The version argument specifies a version constraint." This confirms that registries, including private ones, support semantic versioning.

3. HashiCorp Terraform Documentation, "Module Sources - Generic Git Repository": "Terraform will clone the repository... The ref argument can be used to specify a specific branch, tag, or commit hash." This confirms Git supports versioning but does not mention a browsable directory feature.

4. HashiCorp Terraform Documentation, "Module Sources - Local Paths": "Local path references do not support the version argument." This explicitly states that local modules do not support version constraints.

Scroll to Top