nerdexam
HashiCorpHashiCorp

TERRAFORM-ASSOCIATE-004 · Question #71

TERRAFORM-ASSOCIATE-004 Question #71: Real Exam Question with Answer & Explanation

The correct answer is C: Declare the output in both the root and child module. To surface a value from a child module in the Terraform CLI output, you must declare outputs in both the child module and the root configuration. First, the child module must define an output block to expose the value to its caller. Second, the root (calling) module must define i

Submitted by the_admin· Apr 18, 2026Work with Terraform Modules

Question

How would you output returned values from a child module in the Terraform CLI output?

Options

  • ADeclare the output in the root configuration
  • BDeclare the output in the child module
  • CDeclare the output in both the root and child module
  • DNone of the above

Explanation

To surface a value from a child module in the Terraform CLI output, you must declare outputs in both the child module and the root configuration. First, the child module must define an output block to expose the value to its caller. Second, the root (calling) module must define its own output block that references the child module's output (e.g., value = module.child_module.output_name). Declaring it only in the child module makes the value accessible within Terraform configurations but will not display it in the CLI output. Both declarations are required.

Topics

#Terraform Modules#Module Outputs#Child Modules#Root Module Configuration

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 PracticeBrowse All TERRAFORM-ASSOCIATE-004 Questions