Day 50 of 100
The Terraform Module Change
🔥 Problem Statement
A shared Terraform module — the kind of internal building block several production environments depend on — needs a real behavior change, not just a cosmetic one. Multiple environments consume it, some pinned to specific versions, at least one still pointing at a moving reference that always pulls the latest. There's currently no testing process and no staged rollout for changes to this module; historically, updates have just been merged and consumers pick them up whenever they next run.
🏗️ Environment
- Shared Terraform module: consumed by several production environments
- Change: a meaningful behavior update to the module
- Consumers: pinned to different versions, some to a moving reference
- No current testing or staged-rollout process for module changes
🤔 Your Challenge
How should a change to a widely shared Terraform module actually be rolled out safely?
- What happens to a consumer pinned to a moving reference the next time it runs terraform plan after this change merges?
- Why might a 'meaningful behavior update' be riskier to roll out broadly than a cosmetic one?
- How would you validate the change before any real environment depends on it?
- What would a staged rollout look like for infrastructure code specifically, versus application code?
Solution Hidden
Think through the problem yourself before looking at the answer.
💡Solution
Step 1 — Understand the symptoms
A consumer pinned to a moving reference (a branch name, an unpinned latest-style reference) will pick up this change automatically on its very next plan or apply, whether or not that environment's owners are aware a meaningful behavior change just shipped. That's a real, immediate risk independent of how good the change itself is — an unreviewed, unplanned rollout to production infrastructure the moment someone merges, with no chance for the consuming team to evaluate it first.
Step 2 — Identify the likely bottleneck
The core gap is that shared infrastructure modules are being treated like internal implementation details rather than like a released, versioned dependency — which is what they actually are the moment more than one team or environment consumes them. Without semantic versioning, without a testing step before a change reaches any real environment, and without a staged rollout, every module change carries the full blast radius of "everyone who depends on this, all at once, with no warning" as its default behavior.
Step 3 — Investigation
Before making this specific change, or as a response to recognizing this gap:
- Identify every current consumer of this module and how each one references it — pinned to an exact version, a range, or a moving reference — this maps out exactly who's exposed to unplanned changes and how.
- Assess whether the change is backward compatible — does it change existing resource behavior for consumers using default configuration, or is it purely additive (new optional inputs, new resources that don't affect existing usage)? This determines how much risk the change actually carries.
- Check whether any non-production environment exists that could validate this change first, before it reaches anything consumers depend on for real production infrastructure.
Step 4 — Recommended action
Adopt semantic versioning for the module going forward, and require every consumer to pin to an explicit version rather than a moving reference — this alone converts "everyone gets every change automatically" into "each environment chooses when to adopt a new version," which is the single biggest risk reduction available here.
For this specific change: publish it as a new version rather than modifying the existing one in place, validate it against a non-production environment first, and roll it out to consumers deliberately, one at a time, starting with lower-risk environments — not by merging into a shared reference that every consumer picks up simultaneously. Communicate the change and its impact to every consuming team before they're expected to adopt the new version, giving them the chance to review it against their own environment's specifics.
Step 5 — Engineering lesson
The moment more than one team depends on a piece of shared code — infrastructure or otherwise — it stops being safe to treat casually and starts needing the same release discipline as any other dependency: versioning, a way to validate changes before they reach consumers, and a rollout that consuming teams can control rather than one imposed on them the instant a change merges. Terraform modules are easy to treat informally because they don't look like a "real" published package, but the blast radius of an unreviewed change is exactly the same.
🧠 Today’s Takeaway
Shared infrastructure modules need release discipline.
🔔 Don’t Miss Tomorrow’s Challenge
A new real-world engineering challenge is released every day.
100 Days → 100 Challenges → 100 New Things Learned.
Get the useful stuff, not the noise.
Occasional notes on engineering, Platform Engineering, AI, cloud and things I’m learning along the way.

