hiexam
hashicorp · Terraform-Associate · Q426 · multiple_choice · topic_1

You have declared an input variable called environment in your parent module. What must you do to pass the value to a c…

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?
  • 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
Explanation
Selected Answer: C C is correct as the question is about passing a variable. So if you want the parent to pass its output to its child you need to configure an input variable for that. The name of the input variable makes no sense but maybe that is to emphasize on the fact that the name of the input variable is arbitrary. "That module may call other modules and connect them together by passing output values from one to input values of another." https://www.terraform.io/language/modules/develop

Reference: examtopics_top_comment

Practice with progress tracking

Sign in to track wrong answers, get spaced-repetition reminders, and run timed exam mode.