HashiCorp
TERRAFORM-ASSOCIATE-003 · Question #215
A child module can always access variables declared in its parent module.
The correct answer is B. False. Child modules do not automatically inherit variables from the parent module. To pass values from the parent module to the child module, you must explicitly define input variables in the child module and pass them in the parent module. module "example" { source = "./child_module"
Interact with Terraform modules
Question
A child module can always access variables declared in its parent module.
Options
- ATrue
- BFalse
How the community answered
(30 responses)- A20% (6)
- B80% (24)
Explanation
Child modules do not automatically inherit variables from the parent module. To pass values from the parent module to the child module, you must explicitly define input variables in the child module and pass them in the parent module. module "example" { source = "./child_module"
Topics
#child modules#parent modules#variable scope
Community Discussion
No community discussion yet for this question.