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.
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)- A16% (6)
- B5% (2)
- C73% (27)
- D5% (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
Community Discussion
No community discussion yet for this question.