All articles
  • infrastructure as code
  • Azure
  • Terraform
  • Bicep
  • cloud architecture

Infrastructure as Code Is a Change System

A template can create resources. A mature IaC practice makes infrastructure changes reviewable, repeatable, observable, and recoverable.

Jason Cochran

4 min read
Two engineers review a configuration change, deployment checklist, runbook, and staged environment cards at a desk.

Infrastructure as code is often introduced as a way to create cloud resources from a file. That definition is too small.

The real value is a controlled change system: desired state in version control, reviewable previews, repeatable promotion, policy checks, named deployment identities, drift detection, health verification, and a recovery path.

I have used CloudFormation and infrastructure-as-code practices across projects. The durable lesson transfers across tools: the language is less important than the discipline around change.

Start with an ownership model

Before writing modules, decide which responsibilities belong to the platform team and which belong to workload teams.

A central team may own management groups, subscriptions, networking, identity foundations, policy, logging, and reusable modules. A workload team may own application resources, service configuration, alerts, and scaling rules. The boundary should be explicit so neither side becomes an unreviewed back door or a delivery bottleneck.

Microsoft’s Cloud Adoption Framework separates platform and workload responsibilities and recommends version-controlled IaC for consistency. Shared guardrails should make the normal path easier without hiding who owns the result.

Infrastructure delivery

Operating lifecycle

A production infrastructure change should leave evidence

Infrastructure as code is most valuable when intent, review, deployment, drift, and recovery remain connected.

  1. 01

    Declare

    Define the desired state in reviewed, version-controlled modules.

  2. 02

    Preview

    Inspect Terraform plan, Bicep what-if, policy results, and security findings.

  3. 03

    Promote

    Use governed identities and staged environments to apply the same source.

  4. 04

    Reconcile

    Detect drift, verify health, and preserve a tested recovery path.

Before apply

  • Review the plan or what-if output
  • Run policy and security checks
  • Use a scoped deployment identity

After apply

  • Verify workload health
  • Detect configuration drift
  • Exercise recovery and replacement
Working principleThe template is only one part of IaC. The delivery and reconciliation loop is what makes infrastructure repeatable.

Use one source across environments

Copying an environment folder and editing it by hand creates divergence. Prefer the same modules and source with validated environment-specific parameters.

Development, test, staging, and production should differ intentionally: scale, data classification, region, availability targets, and policy may vary. The structure and review path should remain recognizable.

Keep secrets out of templates and state. Use workload identity or a managed secret store at runtime. Treat state files as sensitive because they can contain resource details and sometimes secret values.

Preview before applying

Terraform plan, Bicep what-if, and CloudFormation change sets exist because infrastructure changes have consequences a syntax check cannot reveal.

A review should distinguish creates, updates, replacements, and deletions. It should flag public network exposure, privilege changes, data-store replacement, region changes, and modifications to monitoring or backup. The person approving production needs a readable summary, not thousands of lines without context.

Use separate identities for preview and apply. Microsoft’s landing-zone guidance recommends read access for planning and controlled write access for deployment, with human approval for production.

Put policy in the delivery path

Policy as code can enforce or audit allowed regions, required tags, encryption, private connectivity, diagnostic settings, approved SKUs, and identity configuration.

Not every policy should block immediately. Measure existing violations, assign owners, and understand exceptions. Then move high-confidence, high-consequence rules toward denial. A policy everyone bypasses is not a guardrail.

Security scanning should include source, dependencies, the generated plan, and the deployment workflow. The plan sees changes a source scanner may miss after variables and modules resolve.

Design modules around stable responsibility

A good module hides repetitive implementation while exposing decisions the workload owner must make. A bad module hides important consequences or becomes a universal object with dozens of switches.

Use modules for boundaries that are reused and governed: a production-ready application service, private data store, monitored queue, or standard workload subscription. Version them, document breaking changes, test representative combinations, and give consumers a migration path.

Detect and reconcile drift

Portal changes happen during incidents, experiments, and support. The problem is not merely that drift exists. The problem is that the team no longer knows which state is intended.

Detect drift regularly. Decide whether the live change should be reverted or incorporated into source. Record emergency changes and set a deadline to reconcile them. Restrict routine production portal access and use just-in-time elevation for exceptional work.

Test recovery, not only deployment

Rollback is not always possible. A resource replacement, database migration, or destructive policy change may require roll-forward recovery. Define that before deployment.

For high-risk changes, test in a production-like environment, preserve the last-known-good source and artifacts, verify backups, rehearse restore, and define the health signals that decide whether to continue.

The output of a successful deployment is not “the command exited zero.” It is a healthy workload whose intended infrastructure matches source.

Review checklist

  1. Who owns the module, deployment, resource, and operational response?
  2. Is the same source promoted across environments?
  3. Are secrets excluded from source, plan output, logs, and state?
  4. Can reviewers see destructive and privilege-changing operations clearly?
  5. Which policies block, audit, or require exception?
  6. Which identity previews and which identity applies?
  7. How is drift detected and reconciled?
  8. Which signals verify workload health after the change?
  9. Is rollback safe, or is roll-forward required?
  10. Has recovery been tested?

IaC is not finished when resources exist. It is finished when the organization can explain, repeat, verify, and recover the change.

Sources and further reading

Share this article

Send it to someone working through a similar architecture decision.

LinkedInXEmail