nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-003 · Question #71

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

The correct answer is C. Declare the output in both the root and child module. To output returned values from a child module in the Terraform CLI output, you need to declare the output in both the child module and the root module. The child module output will return the value to the root module, and the root module output will display the value in the CLI.

Interact 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

How the community answered

(37 responses)
  • A
    16% (6)
  • B
    5% (2)
  • C
    73% (27)
  • D
    5% (2)

Explanation

To output returned values from a child module in the Terraform CLI output, you need to declare the output in both the child module and the root module. The child module output will return the value to the root module, and the root module output will display the value in the CLI.

Topics

#module outputs#root module#child module#output propagation

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-003 Practice