liveBook · Manning

Version pinning

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

Version pinning is the practice of configuring a dependency to use a specific version rather than an automatically selected or latest version.

Version pinning configures a dependency to use a specific module, tool, plugin, or database version instead of accepting automatic updates. In infrastructure as code, it preserves idempotency and helps existing configurations continue using known outputs without introducing drift. section 5.2 section 13.2.1

Apply version pinning as an operational control:

  • Tag and publish a known module release, then refactor every consuming configuration to reference that release. section 5.2
  • Pin module, tool, and plugin versions before upgrading so breaking changes do not reach every consumer automatically. section 13.2.1
  • Review compatibility, defaults, documentation, and commit history before approving a pinned dependency for team use. section 13.1.1
  • Mirror approved modules internally to retain availability when a public endpoint fails, and recheck each new release before approval. section 13.1.3

Database module migration

A database module is tagged v1.0.0 while applications still consume its endpoint and password outputs. Consumers pin v1.0.0 while the module changes to store passwords in a secrets manager. The revised module is tagged v2.0.0; teams then refactor their infrastructure as code to retrieve the password through the new secrets-manager path. section 5.2

Figure 13.5 Before you upgrade a tool, your checklist should include pinning and checking all versions for modules, plugins, and tools.

Use the upgrade checklist to inspect and pin module, plugin, and tool versions before changing infrastructure. section 13.2.1

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

How deep it goes
Explains tagging, refactoring consumers, reviewing compatibility, mirroring artifacts, and preparing staged upgrades.
Examples
Uses Git-tagged database modules, internal artifact repositories, plugin upgrades, and blue-green tool-state migrations.
What it assumes
Assumes infrastructure-as-code configurations, reusable modules, version control, and awareness of tool and plugin dependencies.
What you can do after
Operate/configure infrastructure dependencies with controlled versions and plan upgrades without automatic breaking changes.
How it connects
Connects version pinning with infrastructure as code, idempotency, dependency management, secrets management, and blue-green deployment.

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.