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 ...
}
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.
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.
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.
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)
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.
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.
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.
Module versions are not required but are recommended to avoid unexpected or unwanted changes.
upvoted 4 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
gekkehenk
Highly Voted 1 year, 10 months agoPietjeplukgeluk
1 year, 9 months agomaster9
Most Recent 4 months, 2 weeks agoyubac
1 year, 5 months agoNunyabiznes
1 year, 7 months agocamps
1 year, 7 months agoAtila50
1 year, 8 months agoErrorinprocess
1 year, 8 months agojabli
1 year, 9 months agoprincajen
1 year, 9 months agoprincajen
1 year, 9 months agopyro7
1 year, 9 months agonhvardhan
1 year, 9 months agoOnly5
1 year, 10 months agoAbuu
1 year, 10 months ago