Is a module version required to reference a Module Registry module?

Prepare for the HashiCorp Terraform Associate Exam with quizzes, flashcards, and multiple-choice questions. Each question includes hints and explanations. Boost your confidence and ace your exam!

Multiple Choice

Is a module version required to reference a Module Registry module?

Explanation:
Version pinning for Module Registry modules is optional. You reference a registry module with a source like namespace/name/provider and may include a version to lock to a specific release. If you omit the version, Terraform will fetch the latest published version at init time, which can lead to changes when the registry updates. Because some modules publish multiple versions and others may be used without published versions or with private sources, whether a version is required depends on the particular module you are pulling from the Registry. In practice, for reproducible deployments, you should pin a version whenever possible; for certain modules that are not versioned or for non-registry sources, there is no version to specify. Therefore, it depends on the module.

Version pinning for Module Registry modules is optional. You reference a registry module with a source like namespace/name/provider and may include a version to lock to a specific release. If you omit the version, Terraform will fetch the latest published version at init time, which can lead to changes when the registry updates. Because some modules publish multiple versions and others may be used without published versions or with private sources, whether a version is required depends on the particular module you are pulling from the Registry. In practice, for reproducible deployments, you should pin a version whenever possible; for certain modules that are not versioned or for non-registry sources, there is no version to specify. Therefore, it depends on the module.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy