Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 206


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

Show Answer
Correct Answer: B

Terraform does not require specifying a module version to reference a module on the Terraform Module Registry. When the version is not specified, Terraform will download the latest version available. However, it is generally recommended to specify the version to maintain consistency and prevent unexpected changes in your infrastructure caused by updates to the module.

Discussion

14 comments
Sign in to comment
gekkehenkOption: B
Jan 14, 2023

Specifying a versions is not mandatory. When a version is not specified, Terraform just downloads the latest version

Pietjeplukgeluk
Feb 14, 2023

Correct, you can run "terraform init" without stating the version. It is still recommended to specify the version, but it is not mandatory.

AbuuOption: B
Jan 20, 2023

Module versions are not required but are recommended to avoid unexpected or unwanted changes.

nhvardhanOption: A
Jan 30, 2023

Module Versions are required to reference a correct module.

Only5Option: A
Jan 25, 2023

I think answer should be True, when you want to refer a particular module version is mandatory to use . below answer is from chat GPT Yes, when referencing a module on the Terraform Module Registry, the module version is required. This is because modules on the registry are versioned, and different versions of a module may have different configurations and behaviors.

pyro7Option: A
Feb 6, 2023

True. When referencing a module from the Terraform Module Registry, you must specify a version constraint to indicate which version of the module you want to use. The version constraint is specified in the version argument in the module block. This allows you to lock in a specific version of a module to ensure stability and consistency in your Terraform configurations.

princajenOption: A
Feb 16, 2023

This is true because Terraform Modules are versioned, and versioning ensures that the module being used is stable and won't change unexpectedly. When referencing a module on the Terraform Module Registry, you must specify the module source address and the version of the module to use. This is usually done in the module block of your Terraform configuration.

princajenOption: A
Feb 16, 2023

Yes, it is required. According to the official Terraform documentation: "When you use a module from the Terraform Module Registry, you'll need to specify both the source address and the module version, which will be in the format {NAMESPACE}/{MODULE NAME}/{PROVIDER}/{VERSION}." (source: https://www.terraform.io/docs/language/modules/sources.html)

jabliOption: B
Feb 26, 2023

By default, Terraform will clone and use the default branch (referenced by HEAD) in the selected repository. You can override this using the ref argument.

ErrorinprocessOption: B
Mar 13, 2023

Selecting B: https://developer.hashicorp.com/terraform/tutorials/modules/module-use The version argument is not required, but we highly recommend you include it when using a Terraform module. For supported sources, this argument specifies the module version Terraform will load. Without the version argument, Terraform will load the latest version of the module.

Atila50Option: A
Mar 13, 2023

when fetching a model version is required

campsOption: B
Mar 31, 2023

It''s B - False

NunyabiznesOption: B
Apr 3, 2023

Module version is not required to reference a module on the Terraform Module Registry. If you don't specify a version, Terraform will use the latest version available. However, it is a good practice to specify a version to ensure that your configuration continues to work with the same version of the module, even if newer versions are released.

yubacOption: B
May 30, 2023

it is not mandatory. If not set terraform will download the latest (not recommended)

master9Option: A
Jul 11, 2024

When referencing a module from the Terraform Module Registry, specifying a version is required. This ensures that your infrastructure code is consistent and reproducible by always using the same version of the module. Here is an example of how you would reference a module with a specific version: module "vpc" { source = "terraform-aws-modules/vpc/aws" version = "2.77.0" # ... other module variables ... }