A server that has been patched by hand for three years is a risk nobody can measure. Each change made sense at the time, few were written down, and nobody is sure which settings matter. Martin Fowler calls this a snowflake server: hard to reproduce, hard to change, and hard to audit.[2] Infrastructure as code (IaC) is the main engineering answer to that problem. This article covers the philosophy behind it, its advantages, its disadvantages, and how to decide how far to take it.
TL;DR
- IaC defines computing and network infrastructure in source code that is versioned, tested and delivered like any other software.[1]
- The philosophy rests on six ideas: infrastructure is software, describe the desired state, never hand-edit production, make servers disposable, change in small steps, and let the code serve as documentation and audit trail.[1][3][4]
- The main advantages are consistency, auditability, repeatability and safer change.[1][2]
- The main disadvantages are a learning curve, state and secrets handling, residual drift, abstraction overhead and tool or licence dependence.[4][7][8][9][10]
- For a regulated bank, IaC is a control mechanism and not a compliance certificate. Policy checks, state security and an emergency-access process decide whether it helps.
What infrastructure as code means
Fowler defines IaC as defining computing and network infrastructure through source code that can be treated like any software system, with source control for auditability, testing practices, and continuous delivery.[1] HashiCorp describes the same shift as replacing console clicks and manual commands with configuration files that describe the desired state, which tools then create, modify and manage.[5]
Two distinctions come up in almost every IaC discussion:
- Declarative vs imperative. Declarative tools define the end state and leave the path to the tool. Imperative tools list the execution steps. Microsoft’s Well-Architected guidance prefers declarative tools where possible, because the definition files are simpler and reduce the maintenance burden of deployment scripts.[4] Terraform, Bicep and ARM templates are declarative examples named in that guidance.[4]
- Mutable vs immutable. Mutable infrastructure is changed in place. Immutable infrastructure is replaced with a new version on each deployment. Microsoft recommends immutable infrastructure for business-critical workloads.[4] IBM notes that mutable setups allow ad hoc and emergency fixes but can compromise consistency and make version tracking harder.[6] Our article on immutable software covers the replacement model in more depth.
The philosophy behind IaC
1. Infrastructure is software
If a server, network rule or database is defined in text, it can be reviewed in a pull request, tested, versioned and rolled back. Microsoft’s guidance says to treat IaC like application code, with the same standards for version control, branching, promotion and quality.[4]
2. State what you want, not how to get there
The declarative idea is that you describe the outcome and let the tool work out the operations. IBM describes this as the most common IaC approach, and notes that provisioning is often idempotent: the tool compares existing infrastructure with the desired configuration and changes only what differs, without duplicating resources.[6] Idempotence depends on how the tool and modules are written. IBM Cloud’s documentation warns that custom scripts attached to Terraform resources can break it.[13]
3. The code is the source of truth, so nobody logs in to fix things
Fowler’s rule is direct: at no time should anyone log into a server and make on-the-fly adjustments. Experimenting is acceptable only while developing the code that becomes the lasting definition.[1] Microsoft’s equivalent is a strict policy of deploying infrastructure changes, including configuration changes, only through code and CI/CD pipelines.[4]
4. Servers are disposable (the Phoenix idea)
Fowler suggests regularly burning down servers and rebuilding them from the definition. The main benefit is avoiding configuration drift, meaning unrecorded ad hoc changes. Tools that re-apply configuration only catch drift in areas they control, while a rebuilt server starts from scratch and picks up everything in the source. Fowler recommends using both strategies together.[3]
5. Small, frequent changes
The bigger an infrastructure update is, the more likely it contains an error and the harder that error is to find, especially when several errors interact. Small updates are easier to diagnose and to revert.[1]
6. Documentation and audit come from the same artifact
HashiCorp argues that infrastructure definitions act as living documentation that stays synchronised with deployed resources, unlike separate documents that go stale.[5] Fowler adds that disabling direct shell access and forcing changes through version-controlled recipes gives an audit mechanism that logs every change, which suits regulated environments.[2] Note that these are practitioner and vendor positions. They describe what the approach enables, not what any given implementation achieves.
Advantages
- Consistency between environments. Fowler notes that manual provisioning leads to snowflakes with subtly different configurations and hard-to-debug faults. Code removes that variation.[1] Microsoft advises using the same IaC assets across environments, with parameters for differences, instead of separate files for test and production.[4]
- Safer change. Defined configurations let teams upgrade applications and system software with less risk, find faults faster, and revert to the last working configuration in the worst case.[1] Tools such as
terraform planpreview the changes before anything is applied.[16] - Auditability. Version-controlled definitions mean every configuration change is recorded, rather than relying on manual record keeping.[1]
- Speed and self-service. Executing code is faster than following a manual procedure.[1] HashiCorp’s account of Banco Bradesco, a Latin American bank, reports provisioning time falling from up to 80 days to 5 after it combined Terraform with policy as code, a curated module catalogue of more than 500 modules from more than 20 internal teams, and ServiceNow and CMDB integration.[14] This is a vendor-published account of one bank’s programme. The reduction came from the full operating model, and the source does not isolate how much came from IaC itself.
- Controls that run before deployment. Nirmata’s case study on Razorpay, an Indian payment aggregator regulated under the RBI’s Payment Aggregator Master Directions, describes policy checks in IaC and GitOps pipelines that catch non-compliant manifests and cloud templates, including data-residency boundaries, before anything is provisioned. The same case study also lists admission-time and periodic-scan checks.[15] It is a vendor-run case study centred on Kyverno policies; it does not say which IaC tool Razorpay uses, and it should not be read as proof of any specific stack.
Disadvantages and risks
- A learning curve and specialisation. Microsoft lists new languages and tooling as a cost, and warns that vendor lock-in can make a tool a poor choice.[4]
- Abstraction overhead. More modules and parameters make a system harder to debug and document. Microsoft recommends balancing modularisation against over-engineering.[4]
- State must be managed. Terraform keeps a state file that maps real resources to configuration. By default it is a local file, which limits collaboration and risks loss. HashiCorp recommends a remote backend or HCP Terraform, advises against editing the file directly, and warns against keeping it in version control without locking and access control.[7] Importing existing resources or removing them from state means you must maintain the one-to-one mapping between configuration and real objects yourself.[7]
- Secrets can leak into state. Secret values placed in a configuration can end up in state and plan files, and local state is plaintext.[8] Newer Terraform versions add ephemeral values (1.10+) and write-only arguments (1.11+) to keep values out of state, but provider support varies.[8]
- Drift does not disappear. People can still change resources in the console. HCP Terraform’s drift detection exists for exactly this, and its docs describe two ways to resolve drift: overwrite it by applying, or update the configuration to keep the change.[9] That feature is available in the Standard and Premium editions, so open-source users need their own scheduled checks.[9]
- Orphaned resources. Some tools cannot remove a resource that has left the template, so teams need a scan-and-delete process. Azure deployment stacks are one mechanism that handles removal.[4]
- Licence and vendor dependence. HashiCorp announced on 10 August 2023 that future releases would move to the Business Source License.[11] Terraform 1.6.0 and later are under BUSL 1.1. Production use is permitted unless you offer the software to third parties on a hosted or embedded basis in competition with IBM’s paid versions. Internal use within an organisation is not treated as competitive. Each version converts to MPL 2.0 four years after publication.[10] OpenTofu was created as a fork in response, and its own FAQ says the BUSL terms are ambiguous for some users.[12] Check the current terms with your legal team before standardising on either tool.
- Speed cuts both ways. This is an inference rather than a sourced claim: if code can build a large estate in minutes, a faulty change can alter it just as fast. That is the practical reason to rely on plan review, small changes and scoped state.
When IaC pays off, and when to go lighter
These are judgement calls, not findings from the sources above.
- Strong fit: several environments that should match, regular rebuilds, many teams requesting similar infrastructure, or audit requirements that need a record of every change.
- Weaker fit: a single short-lived experiment, or an environment where the team cannot yet maintain pipelines, state storage and reviews. Partial adoption of the most repeatable layers is a reasonable start.
- Brownfield estates: existing resources need to be imported with care, because wrong state bindings cause surprising plans.[7]
A practical adoption checklist for regulated teams
- Put all infrastructure definitions in version control and require reviewed pull requests.[1][4]
- Run changes only through a CI/CD pipeline, and keep plan output with the change record.[4][16]
- Store state in a remote, encrypted, access-controlled backend with audit logs, and keep secrets out of state where the provider supports it.[7][8]
- Add policy-as-code checks before provisioning, as in the Bradesco and Razorpay accounts.[14][15]
- Schedule drift detection and decide in advance whether drift is reverted or adopted into code.[9]
- Define a documented emergency-access path and a rule that any manual fix is back-ported to code. Fowler’s guidance allows tinkering only as a step toward updating the definition.[1]
- Ask your compliance team which regulatory controls apply to your workloads, including data location, outsourcing and audit. IaC can implement those controls but does not satisfy them by itself.
IaC also underpins internal developer platforms. See our guide to platform engineering and the OpenShift banking platform engineering guide for the next layer up.
Frequently asked questions
Is infrastructure as code the same as DevOps?
No. DevOps is a set of practices and a culture. IaC is one technique within it, applied to infrastructure. Fowler lists continuous testing, small changes and deployment pipelines among IaC practices, which overlap with continuous delivery.[1]
Is Terraform the only option?
No. Fowler’s examples include shell scripts, Ansible playbooks, Chef recipes and Puppet manifests.[1] Microsoft names Bicep and ARM templates as Azure-native declarative tools, and Terraform as another declarative tool supported on Azure.[4] OpenTofu is a fork of Terraform.[12]
Does IaC eliminate configuration drift?
It reduces drift, but it does not remove it, because resources can still be changed outside the code. Rebuilding from the definition, re-applying configuration and drift detection each cover different gaps.[3][9]
Is state in version control acceptable?
HashiCorp advises against storing Terraform state in version control or any storage without state locking and secure access control, because of data loss and secret exposure risks.[7]
Sources
- Martin Fowler, “Infrastructure As Code” (1 Mar 2016) — practitioner essay, Thoughtworks
- Martin Fowler, “Snowflake Server” (10 Jul 2012) — practitioner essay
- Martin Fowler, “Phoenix Server” (10 Jul 2012) — practitioner essay
- Microsoft Azure Well-Architected Framework, “Architecture strategies for using infrastructure as code” — vendor documentation
- HashiCorp Well-Architected Framework, “Use infrastructure as code” — vendor documentation
- IBM Think, “What is infrastructure as code (IaC)?” — vendor explainer, undated
- Terraform documentation, “State” (v1.17.x) — vendor documentation
- Terraform documentation, “Manage sensitive data in your configuration” — vendor documentation
- HCP Terraform documentation, “Health assessments” — vendor documentation
- HashiCorp Terraform LICENSE file (Business Source License 1.1 parameters) — primary licence text
- HashiCorp Licensing FAQ (change history from 10 Aug 2023) — vendor FAQ
- OpenTofu FAQ — project’s own account of why it was created
- IBM Cloud Docs, “What is Infrastructure as Code?” (Schematics) — vendor documentation
- HashiCorp blog, “From 80 days to 5: How Banco Bradesco accelerated digital product delivery with HCP Terraform” (21 Apr 2026) — vendor-published customer account
- Nirmata, “How Razorpay Automates RBI Compliance on Kubernetes with Kyverno” (Oct 2026) — vendor-run case study
- Terraform CLI documentation, “terraform plan” — vendor documentation
