Skip to Content

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: a user with IAM permissions starts a session from the browser or CLI and gets a shell on an EC2 instance or on-premises server running the SSM Agent, with no SSH keys, no bastion and no inbound port 22; session logs go to S3 or CloudWatch Logs Session Manager: a user with IAM permissions starts a session from the browser or CLI and gets a shell on an EC2 instance or on-premises server running the SSM Agent, with no SSH keys, no bastion and no inbound port 22; session logs go to S3 or CloudWatch Logs

A shell without SSH.

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

Systems Manager Run Command: a maintenance window or an EventBridge rule runs a document or script on EC2 instances selected by tag and on on-premises servers with the SSM Agent; command output goes to S3 or CloudWatch Logs and status notifications to SNS Systems Manager Run Command: a maintenance window or an EventBridge rule runs a document or script on EC2 instances selected by tag and on on-premises servers with the SSM Agent; command output goes to S3 or CloudWatch Logs and status notifications to SNS

One command, many servers, no SSH.

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

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

Systems Manager Automation: started from the console, CLI or SDK, a maintenance window, EventBridge or an AWS Config remediation, a runbook restarts EC2 instances, creates AMIs or EBS snapshots, and acts on RDS and other resources Systems Manager Automation: started from the console, CLI or SDK, a maintenance window, EventBridge or an AWS Config remediation, a runbook restarts EC2 instances, creates AMIs or EBS snapshots, and acts on RDS and other resources

Runbooks for routine operations.

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:

AWS documentation

On this page

Open notes

Spotted a mistake?

These notes are open source. Suggest a fix, or star the repo if they helped you.

Suggest an edit

For AI agents: llms.txt · llms-full.txt