Internal module catalog and governance
Turn repeatable designs into a golden path
An internal developer platform offers supported ways to request and operate infrastructure. A golden path is a recommended, documented route from a workload request to a maintained service. It should reduce repeated decisions while leaving a reviewed exception route for unusual requirements. A module catalog stores reusable versioned building blocks; a portal can collect inputs, but must not bypass authorization. A catalog entry needs a maintainer, supported providers and versions, examples, tested invariants, an upgrade guide, costs and retirement rules.
Catalog item: private-service v1.4.2 (fictional)Inputs: name, environment, owner, network_idOutputs: service_id, service_dnsOwner: platform teamUpgrade to v2.0.0: network_id renamed to subnet_id; migration review requiredStatus: hold until caller migration and approved plan are availableThe change to a required input is a breaking interface change for existing callers. Semantic versioning communicates intended compatibility; it cannot prove the resulting plan is safe.
Create explicit release and consumption contracts
Use a standard module directory with main.tf, variables.tf, outputs.tf, README.md, examples and tests as appropriate. Define narrow input types, sensible defaults and validation. Publish only outputs consumers need. Document behavior such as replacement risks, retention and assumptions alongside input names. In a registry-based module call, version constraints govern selection. A local path does not support a module version argument; pin the repository revision in the surrounding delivery process instead. Terraform provider lockfiles record provider selections, not a lock for registry module versions.
module "service" { source = "registry.example.com/northwind/private-service/aws" version = "1.4.2" name = "catalog" owner = "catalog-team" environment = "dev" network_id = "fictional-network"}This is illustrative only: the registry and module do not exist. Do not initialize this snippet. An exact module version is useful for controlled adoption, but the provider version constraints, provider lockfile, provenance and transitive dependencies also need review.
Review breaking releases before promotion
A new major version may rename an input, alter a default, change resource addresses or require a new provider version. Compare old and new interfaces and inspect resource actions in a sandbox plan. If an address changes but ownership does not, review a suitable moved block as taught earlier. If a replacement is necessary, require an explicit data and downtime plan. Test consumer configurations and relevant runtime outcomes before production approval. A registry notification is not consent to deploy an upgrade.
v1: network_id required; existing callers supply network_idv2: subnet_id required; old argument removedReview: update callers + verify network meaning + compare planPromotion: sandbox -> test -> approved productionHold: unexpected replacement or missing rollback evidenceImplement controlled self-service
For a request such as a private service, capture owner, environment, workload purpose, expected capacity, cost allocation and required data handling. Resolve an approved module version and target workspace. Apply authorization checks and evaluate a plan under the target environment identity. An approved plan must correspond to the reviewed inputs and revision; if they change, review again. HCP Terraform offers no-code provisioning for eligible modules and permissions, including workspace creation and a selected module version; verify edition and configuration before assuming availability. A portal should show request status, operation owner and inventory record. It should not hand a user broad deployment credentials.
Request -> authorization -> approved catalog version -> scoped plan -> policy and cost review -> approval -> apply -> health checks -> inventory + owner + lifecycle recordA validation error in the included local request model catches missing owner and invalid environment. That does not authenticate the requester, check budget or prove policy compliance.
Choose a repository topology and manage exceptions
A monorepo can simplify coordinated changes across related modules and roots, but requires ownership rules, change detection and narrowly scoped execution. Multiple repositories can give teams independent release cycles, while requiring versioned contracts and explicit coordination for shared dependencies. Neither layout determines state boundaries automatically. Select based on ownership, release coupling and review needs. Maintain an inventory of consuming roots and module versions. When deprecating a version, communicate the migration path, give consumers a review window and track exceptions with an expiry and owner. Retire only after confirming the applicable consumer and infrastructure lifecycle. An architecture decision record should state context, decision, alternatives, consequences and a review trigger.
ADR-54 (fictional)Decision: shared module repository; independent workload rootsReason: consistent releases with separate environment ownershipAlternative: one repository per moduleTrade-off: coordinated catalog reviews; separate root approvalsRevisit: release coupling or access requirements changeThe practice cases simulate review gates, not actual Terraform policy evaluation. Next: FinOps and infrastructure cost engineering.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Internal module catalog and governance — knowledge check
Review landing-zone architecture and module governance.
A registry module replaces a required input with a new name. What is the compatibility concern?
Which module source supports the Terraform module version argument?
What should occur after a plan was approved but its inputs changed?
Why keep a consumer inventory for a module catalog?
What determines state isolation in a monorepo?