A Terraform output is a named value exported by a module so dependent configurations or users can retrieve selected resource attributes. Outputs create an interface between infrastructure components without requiring direct references to internal resources. section 4.2.1 section 4.3
Use outputs to:
- Pass a network name, subnet address range, bucket name, or other required attribute to dependent resources. section 4.2.1
- Limit the information returned by a low-level module while improving composability and evolvability. section 4.2.1
- Provide an abstraction between high-level and low-level resources through module outputs or infrastructure state. section 4.2.2
Connecting a server to a network
A network module exports its subnet name in terraform.tfstate. A server module reads that output and uses the value to create the server on the correct network. If a queue later needs the subnet IP range, the network module can add that attribute to its outputs. section 4.2.1
Figure 4.8 The facade simplifies attributes to the name of the storage bucket for use by the access control module.
Shows outputs simplifying a storage bucket’s attributes for an access-control module. section 4.3

