Immutable Infrastructure
Immutable infrastructure is an operating model where you replace production resources with newly built versions instead of changing them in place. It makes each deployed version repeatable, testable, and easier to compare with its source definition.
itInfrastructure and operations | OpenSkills.info
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic — Immutable Infrastructure
Immutable infrastructure is the rule that says a running production resource is not a pet project with a screwdriver drawer. When it needs to change, you build a new version and replace the old one. This sounds severe until you meet the alternative: a server that has collected patches, manual fixes, and one mysterious exception made at 02:13 by someone who was probably very tired.
The important trick is that immutable does not mean frozen. The system changes all the time. The change happens in the source definition, image recipe, and deployment configuration, then travels through a build and test path before it reaches production. The running resource gets to be boring. Boring is a fine career for a server.
The first idea to keep is configuration drift, the difference between what a resource was supposed to be and what it has become. Replacing from reviewed inputs limits that accumulation. It also gives a more useful answer to “what is running?”: an artifact identifier, source revision, and evidence, rather than an archaeological dig through shell history.
The second idea is the state boundary. Compute can be disposable; required data cannot. Database records, uploaded files, useful logs, and controlled configuration need a life outside the resource that runs the application. If deleting one instance loses something required, that instance is not yet a safe candidate for replacement. The vocabulary may sound grand. The test is usefully blunt.
The third idea is that replacement needs a recovery path. A blue-green deployment keeps a parallel candidate environment before traffic moves. A canary deployment gives a candidate a small share of traffic first. Both methods buy time to look at health evidence. Neither rewinds an incompatible data change by magic, because magic has an alarming record with database schemas.
This model moves authority into the delivery pipeline. That makes the pipeline worth protecting: its credentials, definitions, scans, and deployment records now decide what production becomes. Exceptional break-glass access still has a place, but its fix needs to return to the source definition or the next replacement politely removes it.
Read the Intro when you need the full replacement loop and the line between durable state and replaceable compute. Use Slides for the flow and rollout comparison. Keep the Cheatsheet nearby when designing a health gate, evidence record, or recovery decision. The Practice Reference turns those ideas into a planning method, and the Exercise lets you test the method without introducing a surprise bill or a surprise outage.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://martinfowler.com/bliki/ImmutableServer.html
Supports
- Immutable servers are replaced rather than modified after deployment
- Base-image changes are tested before rollout
- Configuration should come from outside the server and remain limited
- Durable data and valuable logs require storage outside disposable compute
- Replacement suitability depends on rebuild speed and state boundaries
- https://docs.aws.amazon.com/wellarchitected/2023-10-03/framework/rel_tracking_change_management_immutable_infrastructure.html
Supports
- Immutable infrastructure disallows in-place production updates and deploys new resources
- Consistency, reproducibility, drift reduction, and recovery benefits
- Infrastructure as code and automation as implementation supports
- Canary and blue-green rollout behavior
- Drift detection and restricted modification of running resources
- https://docs.aws.amazon.com/prescriptive-guidance/latest/essential-eight-maturity/theme-2.html
Supports
- Approved secured pipelines as the route for infrastructure changes
- Restricted routine direct access and controlled break-glass access
- Repeatable machine-image and container-image builds
- Infrastructure as code, policy checks, scanning, and compliance monitoring
- Image-pipeline patch management
- https://developer.hashicorp.com/packer/docs
Supports
- Machine images built for multiple platforms from one source configuration
- Templates, validation, plugins, and image lifecycle management
- Golden images as a common organizational use case
- https://developer.hashicorp.com/packer/guides/packer-on-cicd
Supports
- Automated immutable image builds in a continuous delivery pipeline
- Image storage followed by provisioning new instances
- https://docs.hashicorp.com/well-architected-framework/define-and-automate-processes/define/immutable-infrastructure/virtual-machines
Supports
- Building machine images and deploying replacement virtual machines
- Image versioning, automated tests, and instance refresh as an immutable update path
- https://www.hashicorp.com/ar/blog/packer-1-0
Supports
- Packer started in 2013 and reached version 1.0 in 2017
- Packer builds deployment images from a single source configuration
- https://www.docker.com/blog/docker-turns-10/
Supports
- Docker was released as open source in March 2013
- Container images made a portable build artifact available for deployment
- https://www.hashicorp.com/en/blog/terraform-announcement
Supports
- Terraform was announced in July 2014
- Terraform describes and creates infrastructure across providers
- https://kubernetes.io/blog/2024/06/06/10-years-of-kubernetes/
Supports
- Kubernetes was announced in June 2014
- Kubernetes version 1.0 was released in July 2015
- https://aws.amazon.com/about-aws/whats-new/2019/12/introducing-ec2-image-builder/
Supports
- EC2 Image Builder became available in December 2019
- EC2 Image Builder automates image creation, patching, testing, and distribution
- https://www.hashicorp.com/en/blog/announcing-hashicorp-terraform-1-0-general-availability
Supports
- Terraform 1.0 reached general availability in June 2021
- Terraform had been provisioning and managing infrastructure since 2014
- https://www.linuxfoundation.org/press/linux-foundation-announces-intent-to-form-open-tofu-foundation
Supports
- OpenTofu was announced in September 2023 as an open-source fork of Terraform
- https://docs.aws.amazon.com/imagebuilder/latest/userguide/what-is-image-builder.html
Supports
- EC2 Image Builder creates and distributes AMIs and container images
- https://learn.microsoft.com/en-us/azure/virtual-machines/infrastructure-automation
Supports
- Azure lists Packer and Terraform as VM and infrastructure automation tools
- https://www.hashicorp.com/products/packer
Supports
- Packer and HCP Packer support image creation, metadata, governance, and provisioning integration
- https://www.hashicorp.com/products/terraform
Supports
- Terraform provides infrastructure provisioning and automation workflows
