module composition
Building a system from several small modules that pass values to each other through the root module, instead of one large module.
In more detail
HashiCorp recommends a flat structure: the root calls each module and wires one module's outputs into another's inputs. That keeps each module simple and independently reusable.
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.
- monolithic configuration — A single large Terraform directory that holds every resource and environment choice, with no modules.
- root module — The configuration in the directory where you run Terraform commands, which may call other modules.
Taught in
- Providers And The required_providers Block — 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
- Module Scope: What Goes In, What Comes Out — HashiCorp Terraform Associate (004) Exam Prep