HashiCorp
TA-002-P · Question #446
A module can always refer to all variables declared in its parent module.
The correct answer is B. False. 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.
Interact with Terraform modules
Question
A module can always refer to all variables declared in its parent module.
Options
- ATrue
- BFalse
How the community answered
(22 responses)- A14% (3)
- B86% (19)
Explanation
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.
Topics
#modules#module variables#module scope#data passing
Community Discussion
No community discussion yet for this question.