Output values and interfaces
Outputs expose expressions from a root module or child module. They can communicate IDs, URLs, or other useful results. Sensitive outputs suppress ordinary display but remain in state, and commands or downstream consumers may reveal values. Treat output design as an interface with controlled exposure. For example, a network module exposes vpc_id, letting callers reference the ID without reaching into internal resource addresses.
A network module exposes vpc_id, letting callers reference the ID without reaching into internal resource addresses.
A child network module creates subnets and exposes a subnet_ids output. The root caller passes that value into a compute module without needing the network module's internal block names. This lets internal implementation change while preserving the published interface, provided the output's type and meaning remain stable.
An output exposes a selected expression. An interface is the agreement callers rely on. A sensitive output suppresses normal display in supported contexts but remains part of state and may be revealed through explicit commands or downstream usage. Avoid outputting an entire object when callers need one nonsecret field. Names and types should communicate purpose; changing a map into a list can break code even if all IDs remain present. Outputs help compose modules, but do not establish permissions for a caller to use the referenced cloud object or guarantee that the object is operationally ready.
A network module exposes vpc_id, letting callers reference the ID without reaching into internal resource addresses.
Do not overlook this operational distinction: Treat output design as an interface with controlled exposure.