HashiCorp Certified: Terraform Associate — Question 175
How would you output returned values from a child module in the Terraform CLI output?
Answer options
- A. Declare the output in the root configuration
- B. Declare the output in the child module
- C. Declare the output in both the root and child module
- D. None of the above
Correct answer: C
Explanation
The correct answer is C because to access outputs from a child module in the root module, you need to declare the output in both places. Option A is incorrect because declaring only in the root will not capture the child's output, while option B only addresses the child's output without making it available in the root. Option D is incorrect as there is a valid method to achieve this.