Exam Terraform Associate All QuestionsBrowse all questions from this exam
Question 91

Module variable assignments are inherited from the parent module and do not need to be explicitly set.

    Correct Answer: B

    Module variable assignments must be explicitly set by the parent module when it instantiates the child module. Modules do not inherit variables from the parent module. Each module is a self-contained unit, requiring explicit definitions and assignments for its variables.

Discussion
stalk98Option: B

Modules do not inherit variables from the parent module. All modules are self-contained units. So you have to explicitly define variables in the child module, and then explicit set these variables in the parent module, when you instantiate the child module.

EltoothOption: B

B is correct answer : false.

BereOption: B

Module variable assignments must be explicitly set by the parent module when it instantiates the child module. Variable Declaration in Child Module (modules/vm/main.tf): variable "instance_type" { type = string default = "t2.micro" # This is an optional default value. } resource "aws_instance" "example" { instance_type = var.instance_type ami = "ami-abc123" subnet_id = "subnet-1234abcd" } Variable Assignment in Parent Module (main.tf): module "vm" { source = "./modules/vm" instance_type = "t3.micro" # Assigning a value to the variable. } In this example, instance_type is declared as a variable in the child module and is assigned a value by the parent module when it instantiates the vm module. The value "t3.micro" assigned by the parent module will override the default value "t2.micro" declared in the child module.

DineshSGOption: B

I think we are confused between variable assignment and variable declaration. Variable need to be declared in child module but not necessarily be assigned. We can pass values from parent module

modarovOption: B

The answer is False. Module variable assignments are not inherited from the parent module and do need to be explicitly set.

cracitOption: B

Modules do not inherit variables from the parent module. All modules are self-contained units. So you have to explicitly define variables in the child module, and then explicit set these variables in the parent module, when you instantiate the child module.

Ni33Option: A

I think A is the correct answer. Variable value assignments can be passed from root module variables to child module.

amrith501Option: B

Modules do not inherit variables from the parent module