Keeping Fleets Consistent and Patched
This lesson explains how State Manager enforces desired configuration, Patch Manager applies patches and maintenance windows control when disruptive work happens.
Learning outcomes
After completing this lesson, you will be able to:
- Enforce configuration with State Manager associations.
- Approve patches with baselines and patch groups.
- Schedule disruptive work in maintenance windows.
State Manager
A State Manager association binds an SSM document to targets with a schedule, for example installing and configuring the CloudWatch agent every 30 minutes on all instances tagged Env=prod, joining Windows instances to a domain, or collecting inventory daily. Associations run when created, on their schedule and when new matching instances appear, so drift is corrected automatically. Compliance status for each association is reported in Systems Manager Compliance. Associations can also run Automation runbooks against AWS resources.
Patch Manager
Patch Manager scans managed nodes for missing patches and installs them. A patch baseline defines which patches are approved: auto-approval rules by classification and severity with a delay (for example critical security patches approved seven days after release), explicitly approved and rejected patches, and whether non-security updates are included. AWS provides predefined baselines per operating system; custom baselines suit stricter needs. The AWS-RunPatchBaseline document runs with the Scan operation (report only) or Install operation, with a reboot option.
Patching is organised with patch policies created in Quick Setup, which configure scanning and installation across accounts and Regions in an organisation, or, in the older approach, with patch groups (the Patch Group tag) mapped to baselines and run by maintenance windows. Compliance results appear in Patch Manager and Systems Manager Compliance, and can be synchronised to S3 with a resource data sync for reporting with Athena.
The following diagram places the approval delay and the maintenance window on a timeline.

A patching run
Maintenance windows
A maintenance window defines a recurring schedule (cron or rate, with a time zone), a duration and a cutoff after which no new tasks start. Registered targets are nodes or resources; registered tasks can be Run Command documents, Automation runbooks, Lambda functions or Step Functions state machines, each with its own concurrency and error threshold. Maintenance windows ensure that disruptive work, such as patch installation with reboots, happens only in agreed periods. The following table summarises when to use each capability.
| Requirement | Capability |
|---|---|
| Keep software or settings in a defined state continuously | State Manager association |
| Approve and install OS patches with compliance reporting | Patch Manager with a patch baseline |
| Run disruptive tasks only on Sunday 02:00-04:00 | Maintenance window |
| Run a one-off command now on many nodes | Run Command |
| Collect installed software and configuration data | Inventory (through a State Manager association) |
Maintenance window settings
Monthly patching with approval delay
A company must install critical and important security patches on production Linux servers within 14 days of release, but only after they have been on test servers for a week. A custom patch baseline for production auto-approves Security patches of severity Critical and Important seven days after release, while the test baseline approves them immediately. A Quick Setup patch policy scans all nodes daily and installs on test nodes on Wednesday nights and production nodes on Sunday nights, rebooting if needed. A compliance dashboard and a Config rule (ec2-managedinstance-patch-compliance-status-check) report non-compliant nodes.
Which Quick Setup feature manages patching across accounts and Regions?
Show answer
Patch policies.
Exam Tips
Remember for the exam
- State Manager associations enforce desired state on a schedule and on new instances.
- Patch baselines define approval rules; AWS-RunPatchBaseline scans or installs.
- Patch policies (Quick Setup) manage patching across accounts and Regions.
- Maintenance windows restrict disruptive tasks to agreed times.
- Scan reports compliance only; Install applies patches.