IaC Module Design Vocabulary
Module encapsulation, variable validation, output value, module registry — vocabulary for reusable IaC design. Advanced
0 / 5 completed
1 / 5
A Terraform module exposes the following output:
output "rds_endpoint" {
value = aws_db_instance.main.endpoint
}What does this output value provide to callers of the module?
Output values are a module's "return values" — the interface through which a module exposes data to its callers.
| Concept | Syntax | Description |
|---|---|---|
| Module output reference | module.database.rds_endpoint | How the parent module reads an output from a child module |
| Root module output | terraform output rds_endpoint | Root-level outputs are shown after apply and queryable via CLI |
| sensitive = true | output "db_password" { sensitive = true } | Masks the value in terraform output and plan logs |
| output vs. local value | output vs. locals | Outputs are exported to callers; locals are internal to the module |
Modules communicate exclusively via variables (inputs) and outputs (return values). A module cannot read its caller's resources directly — it must receive them as variable arguments.