Exam Terraform-Associate-004 Topic 1 Question 97 Discussion
Actual exam question for HashiCorp's Terraform-Associate-004 exam
Question #: 97
Topic #: 1
Question #: 97
Topic #: 1
A child module can always access variables declared in its parent module.
Suggested Answer: B Vote an answer
Child modulesdo not automatically inheritvariables from the parent module.
To pass values from theparent moduleto thechild module, you mustexplicitly define input variablesin the child module and pass them in the parent module.
Example:
hcl
CopyEdit
module "example" {
source = "./child_module"
var1 = "value"
}
Official Terraform Documentation Reference:
Passing Variables to Modules
To pass values from theparent moduleto thechild module, you mustexplicitly define input variablesin the child module and pass them in the parent module.
Example:
hcl
CopyEdit
module "example" {
source = "./child_module"
var1 = "value"
}
Official Terraform Documentation Reference:
Passing Variables to Modules
by Hedda at Mar 20, 2026, 03:50 PM
0
0
0
10
Comments
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.
Report Comment
Commenting
You can sign-up / login (it's free).