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
E. The version of the module: While specifying a version is recommended, it is not required. If you don’t specify a version, Terraform will use the latest available version.
I think the suitable answers are A & B
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"
}
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.
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.
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.
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
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.
" " "
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.
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.
seifskl
Highly Voted 1 year, 4 months agolavendran93
Most Recent 2 months, 1 week agokareem_ashraf
12 months agokareem_ashraf
12 months agopetersoliman
12 months agoJas14
1 year, 1 month agowh1t4k3r
1 year, 4 months agoTalamak
1 year, 4 months agoraf123123
1 year, 4 months agovibzr2023
7 months, 3 weeks ago[Removed]
1 year, 5 months agoNi33
1 year, 6 months agoStanislav4907
1 year, 7 months agocamps
1 year, 7 months agomamoon_malta2022
1 year, 8 months agoZeppoonstream
1 year, 9 months agoOnly5
1 year, 10 months agoNzudin
1 year, 8 months agoyair319732
1 year, 10 months agoZeppoonstream
1 year, 10 months ago