An infrastructure module is a separable group of infrastructure resources organized around a function or business domain. It acts as a building block: callers compose modules, customize inputs, and consume controlled outputs without managing every resource directly. section 3.2 section 4.2.1
Use modules to keep related resources together while limiting the blast radius of change. A network module can contain a network and subnet; a load-balancer module can combine a load balancer, domain name, and routing rules. Replacing one module should not require rewriting unrelated infrastructure. section 1.3.3 section 3.2
Build and manage a module by applying these practices:
- Group resources that share a function or business domain, then expose only the attributes that dependent modules need. section 3.2 section 4.2.1
- Pass references through inputs and outputs instead of hardcoding identifiers; this loosens dependencies between modules. section 4.0 section 4.2.1
- Choose a pattern according to uniqueness, reuse, update frequency, and composition; factory and prototype patterns commonly support reusable modules. section 3.6
- Share opinionated defaults, test formatting and contracts, run integration tests where practical, and govern disruptive releases. section 5.4 section 6.7.1
Network and server modules
A NetworkModule can create a network and subnet and output the subnet name. A ServerFactoryModule reads that output rather than embedding the subnet identifier, then creates a server on the discovered network. The same arrangement lets another resource consume a subnet address range when the network module exposes it. section 3.2 section 4.2.1
Figure 1.9 You build your production environment with building blocks of infrastructure so you can add new resources, like the premium load balancer, easily.
Use the building-block diagram to trace how network, server, and load-balancer modules compose a production environment and how one module can be replaced or extended. section 1.3.3


































