HashiCorp Certified: Terraform Associate — Question 94
You have declared an input variable called environment in your parent module. What must you do to pass the value to a child module in the configuration?
Answer options
- A. Add node_count = var.node_count
- B. Declare the variable in a terraform.tfvars file
- C. Declare a node_count input variable for child module
- D. Nothing, child modules inherit variables of parent module
Correct answer: C
Explanation
The correct answer is C because child modules require their own input variables to receive values from parent modules. Options A and B do not address passing the variable directly to the child module, and option D is incorrect as child modules do not inherit variables from parent modules automatically.