Patching Fleets at Scale In Place or by Replacement
This lesson explains the two approaches to patching across many accounts and Regions without disrupting workloads, patching in place and replacing instances with rebuilt images, and how mature organisations use both.
Learning outcomes
After completing this lesson, you will be able to:
- Choose between in-place patching and image replacement.
- Describe Patch Manager patch policies and baselines.
- Describe how EC2 Image Builder builds patched images.
- Explain how fleets are patched without downtime.
Two approaches
Vulnerabilities are remediated in one of two ways. In-place patching uses Patch Manager patch policies, set up through Quick Setup, to patch instances across all accounts and Regions during maintenance windows. This suits long-lived servers and lifted-and-shifted workloads that cannot easily be rebuilt. The immutable approach rebuilds golden AMIs and container images with EC2 Image Builder, then replaces running capacity, through an Auto Scaling instance refresh or new task definitions. Every instance then runs a tested image, which suits Auto Scaling groups and containers. The following table summarises the approaches.
| Approach | How | Suited to |
|---|---|---|
| In place | Patch Manager patch policies through Quick Setup, across all accounts and Regions, in maintenance windows | Long-lived servers, lifted-and-shifted workloads |
| Immutable | Rebuild golden AMIs and container images with EC2 Image Builder; roll out with an instance refresh or new task definitions | Auto Scaling groups and containers |
The following diagram compares the two approaches.

Patch in place or replace?
Patch Manager
Patch Manager decides what to install through patch baselines, which approve patches by classification and severity after a delay, for example critical security updates seven days after release, with explicit exceptions. Patch groups, or tags, assign instances to baselines and maintenance windows, so development can be patched a week before production and problems surface where they do least harm.
Patch policies created in Quick Setup apply scanning and installation schedules across the whole organisation, including new accounts, from one place. Every instance reports its patch compliance, which shows which instances are missing patches, and the data can be aggregated centrally with Resource Data Sync for reporting.
Image pipelines
The immutable approach patches images rather than instances. EC2 Image Builder pipelines start from a base image, apply hardening and patches, run tests, and distribute the resulting image to accounts and Regions, either on a schedule or automatically when a new base image is released. The newest approved AMI ID is published to Parameter Store, and launch templates reference the parameter, so new instances always use the current image.
Running instances are then replaced gradually by an Auto Scaling instance refresh, with checkpoints and automatic rollback if alarms fire, so a faulty image is withdrawn before it reaches the whole fleet.
Patching without downtime
Patching causes downtime only if too much capacity is patched at once. Patching one Availability Zone, or a percentage of a fleet, at a time behind a load balancer keeps the rest in service while patched instances reboot. Rate controls and error thresholds in maintenance window tasks stop a bad patch after a few instances rather than letting it spread.
Managed services shift much of this burden: RDS, ElastiCache and OpenSearch apply patches in their maintenance windows, often to a standby first, and serverless services are patched by AWS without any action from the customer, which is one of the operational benefits of choosing them.
Monthly patching for two kinds of fleet
A company runs 900 long-lived EC2 servers from a lift-and-shift migration and 60 Auto Scaling groups for newer applications, across 40 accounts. The long-lived servers are patched in place with a Quick Setup patch policy that targets the whole organisation, scanning daily and installing on the second weekend of each month, development accounts first:
Patch policy "org-monthly"
Targets: all OUs; patch group tag Environment=dev -> Saturday 02:00
Environment=prod -> Sunday 02:00 (one week later)
Baseline: Security and Critical updates, auto-approved 7 days after release
Rate control: 10% of targets at a time, stop at 5% errors
Reporting: compliance aggregated to the delegated administrator accountThe Auto Scaling groups are never patched in place. An EC2 Image Builder pipeline rebuilds the golden AMI when Amazon releases a new base image, runs the test suite, distributes the AMI to all accounts and writes its ID to the Parameter Store parameter /golden/al2023/latest. Launch templates resolve that parameter, and an instance refresh with a checkpoint at 20% replaces instances gradually, rolling back automatically if health checks fail.
What is the difference between patching in place and replacing instances from patched images?
Show answer
Patch Manager updates running instances. An image pipeline builds patched AMIs or containers and replaces the instances, which keeps every instance identical and avoids drift.
Exam Tips
Remember for the exam
- To patch across all accounts and Regions, use Patch Manager patch policies.
- Immutable patching combines Image Builder golden AMIs with an instance refresh.
- Publish the latest AMI ID to Parameter Store for launch templates.
- Patch in stages, using patch groups and rate controls, to limit the impact of a bad patch.
- Managed services remove much of the patching burden.