Module variable assignments are inherited from the parent module and do not need to be explicitly set.
Module variable assignments are inherited from the parent module and do not need to be explicitly set.
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.
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.
B is correct answer : false.
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.
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
The answer is False. Module variable assignments are not inherited from the parent module and do need to be explicitly set.
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.
I think A is the correct answer. Variable value assignments can be passed from root module variables to child module.
Modules do not inherit variables from the parent module