liveBook · Manning

Multiple repository pattern

As explained in Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform

A repository organization pattern that separates infrastructure-as-code configurations or modules into distinct repositories by team or function.

The multiple repository pattern separates infrastructure-as-code configurations or modules into repositories organized by team or function. Each module follows its own lifecycle, while teams download and import the versions they need. section 5.1.2

Apply the pattern by:

  • Creating separate version-control repositories for modules and environment configurations. section 5.1.2
  • Referencing modules through repository URLs and specific Git tags rather than local paths. section 5.1.2
  • Organizing repositories by business domain, function, team, or environment, with consistent naming. section 5.5
  • Adding governance, formatting checks, and versioning practices so independent repositories remain compatible and safe. section 5.1.3 section 5.5

Production configuration with remote modules

A production repository can list tagged tags, network, server, and database modules in requirements.txt, install them from Git repositories, and import them into the infrastructure configuration. section 5.1.2

Figure 5.3 In a multiple repository structure, you store each module in its own code repository. The configuration references the repository URL to use the module.

Use the repository layout diagram to see how each module receives its own repository and how configuration references its repository URL. section 5.1.2

How Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform covers it

How deep it goes
Explains repository splitting, tagged dependency installation, imports, naming, governance, and migration trade-offs without detailing CI implementation.
Examples
Uses tagged Git module dependencies, Python imports, Terraform JSON generation, and team-specific environment repositories.
What it assumes
Assumes familiarity with infrastructure-as-code modules, environments, repositories, dependency installation, and Git tags.
What you can do after
Operate/configure independently versioned infrastructure modules and select a repository structure suited to organizational scale and CI capacity.
How it connects
Connects infrastructure as code with single repository patterns, module versioning, CI frameworks, access control, and artifact repositories.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Infrastructure as Code, Patterns and Practices: With examples in Python and Terraform. The section links point to the parts of the book it draws on.