Getting Infrastructure-as-Code Changes Under Real Governance
Infrastructure-as-code was supposed to make infrastructure changes reviewable the same way application code changes are: a pull request, a diff, an approval. In practice, plenty of teams have the code but not the governance, meaning changes still get applied by hand outside the reviewed path, drift goes undetected for months, and nobody can produce evidence of what actually changed and why when an auditor or an incident review asks.
The fix isn't more tooling on top of what you already have. It's making the existing pipeline the only real path a change can take.
Vendors Covered in this Article
Disclosure: We may earn a commission if you buy through some links on this page. It doesn't change what we recommend.
How do you detect infrastructure drift before governing change?
Governance only works if the code actually represents the current state of your infrastructure; if manual changes have been applied outside the pipeline, your code is already out of sync with reality, and any review process built on top of it is reviewing a fiction. Run drift detection regularly, comparing actual infrastructure state against what the code declares, and treat any drift found as something to reconcile immediately, not a background task to get to eventually.
How do you route every infrastructure change through one reviewed path?
A change applied directly through a cloud console, even a small, well-intentioned one, breaks the premise that your code is the source of truth and undermines every review process built around it. Restrict direct write access to infrastructure to a small, clearly justified set of break-glass scenarios, and route everything else through the same pull-request-and-apply pipeline, so "review the diff before it ships" is actually true for every change, not just the ones someone remembered to make through the proper path.
Tie changes to their actual business reason, not just a diff
A reviewer looking at a raw infrastructure diff, a security group rule added, a resource's size changed, often can't tell whether the change is routine or risky without more context. Require a short, specific description of why a change is being made as part of every pull request, and treat infrastructure changes with elevated risk, anything touching network boundaries, access permissions, or production data stores, with a higher bar for review than a routine capacity change and a named second reviewer where the risk warrants it.
Keep an audit trail that survives longer than your chat history
"We discussed it in a channel" is not evidence an auditor, or a future engineer trying to understand why something is configured a certain way, can rely on. Keep the pull request itself, with its description, review comments, and approval, as the durable record, and make sure whatever mapping you do to a specific compliance control, if you're pursuing one, pulls directly from that record rather than requiring someone to reconstruct history from memory or a chat search months after the decision was actually made.
Calibrate how much friction each kind of change actually deserves
Requiring the same heavyweight review for a routine, low-risk change (bumping an instance count within an already-approved range) as for a change to network isolation or access control slows down the routine work without meaningfully improving safety on the changes that actually carry risk. Tier your review requirements explicitly: lighter, faster review for low-risk categories, and a genuinely thorough review, possibly requiring a second approver, for anything touching a trust boundary or compliance-relevant control. Publish the tiers themselves, not just enforce them silently, so engineers know upfront which category their change falls into before they open the pull request.
For example, imagine a team that bumps an instance count inside an approved range and, the same week, edits a security group to open a port to a partner. Under a tiered policy the first change merges after a single reviewer glances at the diff, while the second needs a written reason and a named second reviewer. A common mistake is to write the tiers down but leave them vague, so engineers guess which category applies and default to the heavier path for everything. The fix is to list concrete examples under each tier, such as capacity changes in the light tier and anything touching network isolation or access control in the heavy tier, and to update those examples whenever a review shows a change was misclassified.
Revisit the policy itself on a schedule
A governance policy written once and never revisited tends to either calcify into pure friction that people route around, or quietly stop matching the actual risk profile of the infrastructure it governs, as new resource types and new attack surfaces get added over time. Review the policy itself, not just individual changes, on a recurring schedule, and specifically ask whether the tiering from the point above still matches where the real risk actually sits today, not where it sat when the policy was first written.
To put the whole policy into practice, work through these steps in order:
- Run drift detection on a regular schedule and reconcile any gap between declared code and actual infrastructure right away, so reviews describe reality.
- Restrict direct write access to a small set of break-glass scenarios, and send every other change through the same pull-request-and-apply pipeline.
- Require a short, specific reason on every pull request, and name a second reviewer for changes touching network boundaries, access permissions, or production data stores.
- Keep the pull request, with its description, review comments, and approval, as the durable audit record instead of relying on chat history.
- Publish explicit review tiers, lighter for routine capacity changes and thorough for trust boundaries, so engineers know the bar before they open a pull request.
- Review the policy itself on a recurring schedule and check whether the tiers still match where the real risk sits today.
What Good Looks Like
Real infrastructure-as-code governance means drift is detected regularly and reconciled promptly, every change goes through the same reviewed path with a small, defined exception process for emergencies, changes are tied to a stated reason with risk-tiered review, and the pull request record itself serves as durable audit evidence.
Building The Capability (5-Stage Skill Ladder)
How to Get Started
Disclosure: We may earn a commission if you buy through some links on this page. It doesn't change what we recommend.
Vanta can pull change-management evidence directly from a reviewed infrastructure-as-code pipeline, which is a meaningfully stronger audit trail than reconstructing history from chat logs after the fact.
Drata tracks the same kind of recurring evidence, which is useful if infrastructure change management is one of several controls you're already tracking there rather than in a separate system.
Frequently Asked Questions
How do we handle a genuine emergency that can't wait for normal review?
Define a specific, limited break-glass process ahead of time, who can invoke it, what it allows, and a requirement that the change is retroactively reviewed and reconciled into the codebase within a set window afterward. An undefined emergency exception is how break-glass access quietly becomes the default path for anything inconvenient.
Does infrastructure-as-code governance slow teams down?
Poorly tiered governance does, by treating every change with the same weight regardless of actual risk. Well-tiered governance, light review for routine changes and real scrutiny for high-risk ones, tends to speed teams up overall by making routine changes fast and predictable while still catching the changes that matter.
How often should drift detection run?
Frequently enough that drift is caught within days, not months. Many teams run it on a daily schedule or trigger it on any manual console access to infrastructure, so a change applied outside the pipeline is flagged quickly rather than discovered much later during an unrelated investigation.
About the numbers
This guide doesn't quote a sourced benchmark. Figures in it are estimates or general guidance, so check them against your own numbers.
Related Guides
Getting Agentic AI Systems Through a SOC 2 Audit
What a SOC 2 auditor actually asks about an AI agent system, and the specific evidence a CTO needs ready before the audit starts.
Auditing Security on Your MCP and Agent Tool Stack
A step-by-step way for a CTO to audit which tools an AI agent can reach, what each one can do, and where the access is broader than it should be.
How to Roll Out AI Code Review Without Losing Trust
A step-by-step guide to adding an AI reviewer to your pull request flow: what to feed it, how to tune it, and where humans stay in the loop.
Rolling Out Agentic Workflows Without Breaking Production
A practical rollout checklist for shipping an AI agent to production, from a shadow-mode test run through the guardrails that catch it if it misbehaves.
Terraform or Pulumi: Choosing an Infrastructure-as-Code Tool You Won't Rewrite Later
How Terraform's declarative HCL and Pulumi's general-purpose code differ, where each helps governance, and what switching later costs.
Build vs. Buy for Verifying Every Device That Connects In
What zero-trust device and identity verification actually requires, what a platform gives you over a homegrown check, and how to decide between them.