module interface
The variables a module accepts and the outputs it publishes, which together are everything a caller may rely on.
In more detail
Keep it small: an input should be a decision the caller really owns, and an output a value the caller really needs. Describe it in a README and in variable and output descriptions. Renaming or removing any part of it is a breaking change.
Related terms
- Terraform module — A directory of Terraform files with inputs (variables) and outputs, which other configurations can call to reuse the same infrastructure design.
- input variable — A named, typed value a configuration or module takes from outside, declared in a variable block and read as var.<name>.
- output value — A named value a configuration publishes after apply, declared in an output block, like the return value of a function.
- breaking change — A change that makes existing users of a program or interface stop working until they change something too.
- README — A text file, usually README.md, at the top of a project that explains what it does and how to use it.
Taught in
- Return Values: Outputs And Locals — Infrastructure as Code with Terraform
- Why Modules: Composition Versus Monoliths — Infrastructure as Code with Terraform
- Writing A Custom Network Module — Infrastructure as Code with Terraform
- Calling Your Module And Passing Variables — Infrastructure as Code with Terraform
- The Terraform Registry And Public Modules — Infrastructure as Code with Terraform
- Versioning And Pinning Modules — Infrastructure as Code with Terraform
- Module Scope: What Goes In, What Comes Out — HashiCorp Terraform Associate (004) Exam Prep