AWS Systems Manager
AWS Systems Manager for managing EC2 and on-premises servers, Session Manager, Run Command, Patch Manager, Maintenance Windows and Automation runbooks.
What it is
AWS Systems Manager (SSM) manages EC2 instances and on-premises servers at scale.
- A server becomes a managed node when the SSM Agent is installed (it's preinstalled on Amazon Linux and many AMIs) and it has IAM permissions to talk to Systems Manager (an instance role with
AmazonSSMManagedInstanceCore). - Works on Linux, macOS and Windows, in AWS and on premises (hybrid).
- It's a family of tools; the ones below are the most important for the exam. (Parameter Store is covered in the Security & Encryption group.)
Session Manager
Session Manager starts a secure shell on EC2 instances and on-premises servers.
- No SSH access, bastion hosts or SSH keys needed.
- No port 22 needed (better security): close all inbound ports.
- Supports Linux, macOS and Windows.
- Access is controlled with IAM, and session log data can be sent to S3 or CloudWatch Logs.
It appears in the connecting to EC2 lab.
Run Command
- executes a document (= script) or just runs a command;
- runs it across multiple instances (selected by tags or resource groups);
- no need for SSH;
- shows command output in the console, or sends it to an S3 bucket or CloudWatch Logs;
- sends notifications to SNS about command status (in progress, success, failed…);
- is integrated with IAM and CloudTrail;
- can be invoked by EventBridge.
Patch Manager
- automates patching of managed instances: OS updates, application updates, security updates;
- supports EC2 instances and on-premises servers, on Linux, macOS and Windows;
- patches on demand or on a schedule with Maintenance Windows;
- scans instances and produces a patch compliance report (missing patches).
Under the hood, it runs the AWS-RunPatchBaseline document through Run Command.
Maintenance Windows
A maintenance window defines a schedule for when to perform actions on the instances: OS patching, updating drivers, installing software…
A maintenance window contains:
- a schedule (for example every Sunday at 02:00);
- a duration;
- a set of registered instances;
- a set of registered tasks (Run Command, Automation, Lambda…).
Automation
SSM Automation simplifies common maintenance and deployment tasks of EC2 instances and other AWS resources.
- Examples: restart instances, create an AMI, take an EBS snapshot.
- An Automation runbook is an SSM document that defines actions on EC2 instances or AWS resources (pre-defined by AWS, such as
AWS-RestartEC2Instance, or custom). - Can be triggered:
- manually, with the AWS console, CLI or SDK;
- by EventBridge;
- on a schedule with Maintenance Windows;
- by AWS Config for rule remediations.
Real-world examples
- A company closes port 22 on every instance and gives engineers shell access only through Session Manager, with every session logged to S3.
- An operations team patches 500 Windows and Linux servers every Sunday night with Patch Manager in a maintenance window, and checks the compliance report on Monday.
Exam tips
- "Shell access without SSH, bastion hosts, keys or port 22" → Session Manager.
- "Run a script on many instances at once" → Run Command.
- "Patch EC2 and on-premises servers, compliance report" → Patch Manager (+ Maintenance Windows).
- "Automate routine tasks: restart, AMI, snapshot" → SSM Automation runbooks.
- "Instance doesn't appear in Systems Manager" → check the SSM Agent and the instance's IAM role (and network access to SSM endpoints).
Common traps
- "Session Manager needs port 22 open." It needs no inbound ports at all.
- "Systems Manager only works on EC2." It also manages on-premises servers.
Check yourself
The Session Manager lab is on the connecting to EC2 page; the rest needs several instances, so instead:
Use Session Manager with no inbound ports open, IAM to control who can start sessions, and session logging to S3 or CloudWatch Logs.
Install the SSM Agent (hybrid activation for on premises), then use Patch Manager with a patch baseline, scheduled by a maintenance window, and read the patch compliance report.
AWS documentation
AWS CloudFormation
AWS CloudFormation as infrastructure as code, its benefits, the visual Infrastructure Composer editor, the CloudFormation service role and iam:PassRole, and StackSets for many accounts and Regions.
AWS X-Ray
AWS X-Ray for distributed tracing, traces, segments and the trace map, sampling, the services it integrates with, and the move to OpenTelemetry.