- Immutable: build a brand-new house with all updates, move in, and demolish or sell the old house — no dust, no live disruption.
- Mutable: renovate the existing house while people live in it — occupants see changes as they happen and may experience interruptions.
Mutable deployments
Mutable deployments modify existing systems in place. Typical workflows include SSH/SSM access, running configuration management, or applying patches directly on the running instance.
- In-place OS or package updates (patch management).
- Live configuration changes using Chef, Puppet, Ansible, or similar.
- Manual SSH/SSM changes for emergency fixes.
- Pros: fast for small, targeted changes; minimal short-term resource use.
- Cons: risk of configuration drift, state divergence between hosts, more complex rollback and debugging, and a weaker security posture over time.
Immutable deployments
Immutable deployments avoid changing running instances. Instead you build a new artifact (VM image, container image, Lambda version), deploy the new instances, shift traffic, and terminate or retain the old instances as a rollback target. This prevents in-place drift and ensures reproducible environments.
Key properties and tooling

AWS-specific immutable examples
- AMI-based pipeline: bake an AMI (e.g., via EC2 Image Builder), launch from that AMI using Auto Scaling or CloudFormation, then replace the old fleet.
- Blue/Green: run two complete environments (blue and green) and flip traffic between them (Elastic Beanstalk supports this).
- Canary / Weighted routing: shift a percentage of traffic to the new version and increase based on telemetry (Route 53 weighted routing, ALB target groups, API Gateway).
- Lambda versions and aliases: route a percentage of traffic to a new Lambda version and then move the remainder once validated; can be orchestrated via CodeDeploy.

- Instant rollback by switching traffic back.
- Minimal user disruption on cutover.
- Safer validation because production traffic can be used for testing with a controlled blast radius.

Lambda and traffic shifting
Lambda supports versioning and aliases, which let you route a percentage of invocation traffic to a new version and then move the remainder after validation. API Gateway and CodeDeploy provide orchestration for automated canary or linear traffic shifts.
Common immutable deployment patterns
- AMI-based: bake machine images and replace instances (EC2 Image Builder, Auto Scaling, CodeDeploy).
- Blue/Green: run two complete environments and flip traffic (Elastic Beanstalk, ECS, ALB, Route 53).
- Canary / Weighted deployments: incrementally shift traffic (Route 53 weighted routing, ALB, API Gateway).
- Lambda versioning: control traffic using versions/aliases (CodeDeploy for automated strategies).

Summary — trade-offs and when to choose each

For production systems, prefer immutable deployment patterns (containers, Lambda versions, AMI baking + Auto Scaling or blue/green) to minimize configuration drift and simplify rollback. Use mutable approaches selectively when you need very small, rapid changes and can tolerate higher operational risk.
References and further reading
- AWS EC2 Image Builder
- Blue/Green Deployments on AWS Elastic Beanstalk
- AWS Lambda Versioning and Aliases
- AWS CodeDeploy — Blue/Green Deployments