AWS Learning Journey

The AWS Service That Runs Your Fleet While You Sleep: Systems Manager

Parameter Store, Session Manager, Run Command, Patch Manager, Automation runbooks, State Manager, Inventory, Distributor, and maintenance windows — operations automation without SSH.

7 min read · 1352 words
AWSSystems ManagerDevOpsAutomationSite Reliability Engineering
The AWS Service That Runs Your Fleet While You Sleep: Systems Manager cover image

AWS from Zero to Production — Phase 6, Part 4 of 5 · See the full series roadmap


Infrastructure as Code creates your servers. But who patches them every month? Who restarts the stuck service on 40 instances at 2 a.m.? Who knows which machines still run a vulnerable version of OpenSSL? And how do engineers get a shell when something breaks — without SSH keys?

On AWS, the answer to all of those is AWS Systems Manager.

It’s not one service; it’s a toolbox of capabilities that share one agent and one permissions model. Most teams use two or three of them and never discover the rest. This article tours the ones that matter.

What you’ll walk away with


How Systems Manager works

Systems Manager manages nodes — EC2 instances, and on-premises servers and VMs registered as hybrid nodes.

Each managed node needs:

  1. The SSM Agent, preinstalled on Amazon Linux, Windows Server, and many other AWS-provided AMIs.
  2. IAM permissions, usually through an instance profile with AmazonSSMManagedInstanceCore. Default Host Management Configuration can also grant these to EC2 instances account-wide.
  3. Network access to Systems Manager endpoints — through a NAT gateway, or interface VPC endpoints for ssm, ssmmessages, and ec2messages.

The agent makes outbound connections only. You never open inbound ports.

aws ssm describe-instance-information \
  --query 'InstanceInformationList[].[InstanceId,PingStatus,PlatformName]' \
  --output table

If a node shows Online, you can manage it.

Engineer’s note: Many teams use Quick Setup in the console to configure agent updates, inventory, and patching for a whole organization in a few clicks.


Parameter Store

You met Parameter Store in Phase 2 for secrets. It’s just as useful for configuration:

/orders/dev/db-host
/orders/dev/feature-flags/new-checkout
/orders/prod/db-host
/orders/prod/feature-flags/new-checkout
aws ssm get-parameters-by-path --path /orders/dev --recursive --with-decryption

Session Manager

You met Session Manager in Phase 4. Here’s the full picture:

Port forwarding — the hidden gem

Need to reach a private RDS database from your laptop? Forward a local port through an instance in the VPC:

aws ssm start-session \
  --target i-0123456789abcdef0 \
  --document-name AWS-StartPortForwardingSessionToRemoteHost \
  --parameters '{"host":["orders-db.abc123.us-east-1.rds.amazonaws.com"],"portNumber":["5432"],"localPortNumber":["15432"]}'

Then connect your database client to localhost:15432. The database stays private, and access is controlled and logged by IAM.


Run Command

Run Command runs a command or script on many nodes at once, selected by ID, tag, or resource group:

aws ssm send-command \
  --document-name AWS-RunShellScript \
  --targets Key=tag:App,Values=orders Key=tag:Env,Values=prod \
  --parameters 'commands=["systemctl restart orders-worker","systemctl is-active orders-worker"]' \
  --max-concurrency 25% \
  --max-errors 1 \
  --output-s3-bucket-name acme-ssm-output

Commands are defined by SSM documents — AWS provides hundreds, and you can write your own.


Patch Manager

Patch Manager scans and installs operating system patches:

Engineer’s note: For immutable infrastructure — containers, or instances rebuilt from fresh AMIs — the real “patch” is rebuilding from an updated image with EC2 Image Builder. Patch Manager is essential for long-lived instances you can’t easily replace.


Automation runbooks

Automation runs multi-step runbooks for common operational tasks:

AWS provides many ready-made runbooks, like AWS-RestartEC2Instance and AWSSupport-TroubleshootSSH. You can write your own in YAML:

schemaVersion: '0.3'
description: Restart the orders worker and verify it
parameters:
  InstanceId:
    type: String
mainSteps:
  - name: restartService
    action: aws:runCommand
    inputs:
      DocumentName: AWS-RunShellScript
      InstanceIds: ['{{ InstanceId }}']
      Parameters:
        commands:
          - systemctl restart orders-worker
          - systemctl is-active orders-worker

Runbooks can include approval steps, branching, and API calls. They’re how you turn a wiki page of manual steps into a reliable, repeatable button.


State Manager

State Manager keeps nodes in a desired state, continuously:

You create an association between a document and a set of targets, with a schedule. New instances matching the targets are configured automatically.


Inventory

Inventory collects metadata from managed nodes: installed applications and versions, network configuration, Windows updates, services, and more.

Questions it answers:

Combine it with Resource Data Sync to send inventory to S3 and query it across accounts with Athena (Phase 9).


Distributor

Distributor packages and distributes software — agents, tools, and drivers — to managed nodes. AWS publishes packages like the CloudWatch agent; you can publish your own and install them through Run Command or State Manager.


Maintenance windows

A maintenance window is a schedule for disruptive tasks:

Window: prod-sunday-0300   (cron: Sundays 03:00 UTC, duration 3 hours, stop new tasks 1 hour before end)
  Targets: instances tagged Env=prod, PatchGroup=web
  Tasks:
    1. Run Command: AWS-RunPatchBaseline (Install)   max concurrency 20%
    2. Automation:  verify health after patching

Windows make sure risky work happens only at agreed times — and never runs into business hours.


Putting it together

A typical operations setup for long-lived instances:


Common mistakes


Key takeaways


Quick self-check

Test yourself before moving on:

  1. An instance doesn’t appear in Systems Manager. What three things do you check?
  2. How can you connect a local database client to a private RDS instance without a VPN?
  3. Which capability keeps an agent installed on every new instance automatically?
  4. How do you limit a Run Command rollout to a quarter of instances at a time?

Answers

  1. The SSM Agent, the instance role, and the network path to Systems Manager.
  2. Session Manager port forwarding through an instance in the VPC.
  3. State Manager.
  4. --max-concurrency 25%.

What’s next

In Part 5, the Phase 6 lab: rebuild the entire Phase 5 stack — VPC, ECR, ECS, RDS, IAM, and CloudWatch alarms — with Terraform, using remote state in S3. Then watch Terraform detect and fix a manual change.

Which Systems Manager feature surprised you most? Tell me in the comments.


Share this article

LinkedIn post draft