Immutable infrastructure treats deployed servers or containers like constants: once live, they are not patched or tweaked. Instead, change the blueprint, build a replacement, move traffic to it, and remove the old instance. It is the printed-flyer approach to server updates: fix the source, then replace the copies. section 9.8.2 section 9.12
For a server that needs a security patch:
- Update the Terraform configuration or Dockerfile. section 9.8.2
- Build and deploy a fresh, patched replacement; check that it works. section 9.8.2
- Route traffic to the replacement, then destroy the old instance. section 9.8.2
Blue-Green Deployment names this switch: keep the old Blue environment available while verifying Green, then redirect traffic. If the new version fails, switch back. Rebuilding avoids configuration drift and makes rollback straightforward; frequently replacing instances can also remove malicious changes. Stateful databases are an exception: their persistent data requires careful change management. section 9.8.2 section 9.8.3
Figure 9.6 The Immutable Deployment Pipeline. Instead of patching live servers, we build a fresh Server Image from our code, deploy a new instance, automatically verify its health, seamlessly swap the user traffic at the Load Balancer, and finally destroy the old infrastructure.

See the deployment sequence: build a fresh image, verify the new instance, switch traffic at the load balancer, and remove the old infrastructure. section 9.8.2

