When using a module from the public Terraform Module Registry, the following parameters are required attributes in the module block. (Choose two.)
When using a module from the public Terraform Module Registry, the following parameters are required attributes in the module block. (Choose two.)
When using a module from the public Terraform Module Registry, you must provide the module's source address to tell Terraform where to find the module. Additionally, you must provide values for any required input variables that the module needs to function correctly. The version of the module is not strictly required; if not provided, Terraform will use the latest version available by default, making the inclusion of the version optional rather than mandatory. Therefore, required attributes in the module block are the module's source address and each of the module’s required inputs.
A. Each of the module’s required inputs B. The module’s source address These two parameters are required when using a module from the Terraform Module Registry. The module's source address tells Terraform where to find the module. The required inputs for the module must be specified so that Terraform can configure the module correctly. The Terraform Module Registry does not require an account token for use, and dependencies should be managed inside the module itself. The version of the module is not strictly required; if not provided, Terraform will use the latest version available. You can refer to this link https://developer.hashicorp.com/terraform/language/modules/syntax it is mentionned that : - "The source argument is mandatory for all modules." - "All modules require a source argument" - "The version argument is recommended for modules from a registry." which means that it is not required
Version is not mandatory. Only mandatory is "source" and the input vars that are mandatory for the module to operate.
Version is not required https://developer.hashicorp.com/terraform/language/expressions/version-constraints
B and E are correct answers. A is not correct option because input variables can be defaulted to.
When using a module from the public Terraform Module Registry, you need to include certain attributes in the module block to properly reference and configure the module. A) Each of the module's required inputs: Modules can have input variables that allow users to customize the behavior of the module. In the module block, you must provide values for all required input variables. If a module has optional input variables, you can also provide values for those, but they will have default values if not specified. B) The module's source address: The source address tells Terraform where to find the module's source code. For modules hosted on the Terraform Module Registry, the source address is usually in the format <NAMESPACE>/<NAME>/<PROVIDER>. The version of the module is an optional attribute. If not specified, Terraform will use the most recent version of the module that is compatible with your Terraform version. However, it is a good practice to specify a version to ensure consistent behavior across different environments and Terraform runs.
Modules on the public Terraform Registry can be referenced using a registry source address of the form <NAMESPACE>/<NAME>/<PROVIDER>, with each module's information page on the registry site including the exact address to use. module "consul" { source = "hashicorp/consul/aws" version = "0.1.0" }
I think iam wrong version is not needed I would go for A,B
A and B
Look under the Provision Instructions. Only source and version are required. https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws/latest
B. The module’s source address and E. The version of the module are required attributes in the module block when using a module from the public Terraform Module Registry. The source parameter specifies the source location of the module, which can be a Git URL, local file path, or a Terraform Registry module identifier. This is necessary to locate the module to be used. The version parameter specifies the version constraint of the module, which can be a specific version number or a version constraint. This is necessary to ensure that a consistent version of the module is used across different Terraform runs. The other options listed are not required attributes in the module block. Each of the module’s required inputs are defined separately in the module and can be specified in the module block as needed. The Terraform Module Registry account token is not required to use a public module. The module’s dependencies (example: submodules) are not required in the module block but can be defined in the module as necessary.
Answer is A & B version is not a required attribute, if you do not specify version it will get the latest version by default
B. The module’s source address E. The version of the module When using a module from the public Terraform Module Registry, the following parameters are required attributes in the module block: B. The module’s source address: The source argument in the module block is required and it contains the address of the module in the public Terraform Module Registry. E. The version of the module: The version of the module is also required and it is used to specify which version of the module should be used. A. Each of the module’s required inputs: The required inputs are defined by the module provider and should be passed as variables to the module block. C. Terraform Module Registry account token: Account token is not required, it could be used for authentication but it's not required for using a module from the public Terraform Module Registry. D. Each of the module’s dependencies (example: submodules): Dependencies are not required, but if the module has any submodules, it should be added as a source of the submodule in the root module.
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. Modules can contain both required and optional arguments. You must specify all required arguments to use the module. from Hashicorp's official site.
A little bit of confusion here, so I've just tested it and called a module from public registry, specifying the source and required variables only and it worked. Therefore, I suggest the correct answer is A, B.
Answer BE
E Version is not required
A. Each of the module’s required inputs: When using a Terraform module, you need to specify the input variables the module requires. This ensures the module has all the necessary information to run correctly. You need to provide values for each of the module’s required inputs in the module block. B. The module’s source address: The source address specifies where Terraform should find the module in the Terraform Module Registry. This includes the registry name and the module name, along with the version of the module you want to use. The source address is a required attribute in the module block and it helps Terraform download and install the module from the registry.
I go with B and E w.r.t The source argument is mandatory for all modules. The version argument is recommended for modules from a registry. https://developer.hashicorp.com/terraform/language/modules/syntax
if there is no version set it will take the lates one so it is not required.
The answer is A,B .. version isnt mendatory: " " " Registry modules support versioning. You can provide a specific version as shown in the above examples, or use flexible version constraints. " " "