Lesson 4 of 5 AWS Systems Manager

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.

Patching with an approval delay. A critical security patch released on day 0 is auto-approved by the baseline seven days later. The next maintenance window after approval runs AWS-RunPatchBaseline with the Install operation and reboots if needed, while scans report compliance in between.
The days are illustrative. Scans change nothing; only the Install operation patches nodes.
Put in order

A patching run

Exam skills 3.2.1

Put the parts of a Patch Manager rollout in order.

Log in to try this activity Interactive activities are free with an account.

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.

RequirementCapability
Keep software or settings in a defined state continuouslyState Manager association
Approve and install OS patches with compliance reportingPatch Manager with a patch baseline
Run disruptive tasks only on Sunday 02:00-04:00Maintenance window
Run a one-off command now on many nodesRun Command
Collect installed software and configuration dataInventory (through a State Manager association)
Match the pairs

Maintenance window settings

Exam skills 3.2.1

Match each maintenance window setting with what it controls.

Log in to try this activity Interactive activities are free with an account.
Worked example

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.

Check yourself

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.