Skill 5.2.2
Exposing values with module outputs
Key Concepts
If a parent needs a value from a child, such as a subnet ID, the child must declare output "subnet_id" { value = aws_subnet.this.id }, and the parent reads module.network.subnet_id. Resources inside the child cannot be referenced directly as module.network.aws_subnet.this in expressions, although that is their address in state.
This encapsulation lets module authors change internals without breaking callers as long as the variables and outputs stay the same. Outputs of child modules are not printed after apply; to show one, re-export it with an output in the root module.