AWS Systems Manager for EC2: Patching, Run Command and Parameter Store

AWS Systems Manager for EC2: Patching, Run Command and Parameter Store

Written by

in

Once you run more than a couple of EC2 instances, logging into each one to install updates or change a setting stops scaling. AWS Systems Manager gives you one place to patch, run commands, connect to and configure every server, without opening SSH ports or juggling key pairs. Most of its EC2 features cost nothing extra.

This guide covers getting instances managed, setting up patching, running commands at scale, storing configuration in Parameter Store, and the common reasons instances do not show up.

What Systems Manager covers

Systems Manager is a collection of tools for operating servers on AWS and elsewhere: Fleet Manager to view managed nodes, Session Manager for shell access, Run Command for one-off commands, Patch Manager for updates, State Manager for keeping settings applied, Parameter Store for configuration, Inventory for installed software, and Automation for runbooks. AWS documents them in the Systems Manager user guide.

AWS Systems Manager for EC2: the SSM Agent connects instances, Patch Manager keeps them updated, Run Command and Session Manager handle operations, and Parameter Store holds configuration
Once the agent and an instance role are in place, one console patches, configures and connects to every server.

Making instances managed nodes

  1. Agent: the SSM Agent is preinstalled on many AWS AMIs, including Amazon Linux 2023, recent Ubuntu and Windows Server. Install it on other images.
  2. Permissions: attach an instance profile with the AmazonSSMManagedInstanceCore policy, or enable Default Host Management Configuration in the Region so instances are covered without per-instance roles.
  3. Network: the agent needs outbound HTTPS to Systems Manager endpoints, through the internet, a NAT gateway, or interface VPC endpoints for ssm, ssmmessages and ec2messages in fully private subnets.
  4. Check: the instance should appear in Fleet Manager within a few minutes.

Quick Setup can configure roles, patching and inventory across an account in a few clicks. The IAM roles guide explains instance profiles.

Key tools side by side

ToolWhat it doesReplaces
Session ManagerBrowser or CLI shell, logged, no inbound portsSSH or RDP with keys and open ports
Run CommandRun a script on many instances at onceLogging into each server
Patch ManagerScan and install OS updates on a scheduleManual apt or yum updates
Parameter StoreStore config and secrets by pathConfig files and env vars on servers
InventoryCollect installed software and settingsSpreadsheets and manual audits
State ManagerKeep a configuration applied over timeDrift between servers

Patching with Patch Manager

A patch baseline defines which updates are approved, for example security and critical updates released at least seven days ago. A patch policy or a maintenance window decides when instances scan and install. Start with scan-only to see what is missing, then schedule installs during low-traffic hours. Patching can reboot instances, so for web tiers patch in batches behind a load balancer; the Auto Scaling and load balancer guide explains why replaceable instances make this easy. Patch compliance appears in the Systems Manager console.

Run Command and Session Manager

Run Command executes documents such as AWS-RunShellScript or AWS-RunPowerShellScript on instances selected by ID or tag, with concurrency and error limits, and logs output to S3 or CloudWatch. Session Manager gives an interactive shell over an outbound connection, so instances need no public IP or inbound port 22. Session activity can be logged for audit. The secure EC2 access guide covers Session Manager in depth, and fewer public IPs also lowers cost, as the public IPv4 costs guide explains.

Parameter Store

Parameter Store holds configuration values in a hierarchy such as /shop/prod/db-host. String and StringList parameters hold plain settings; SecureString parameters are encrypted with KMS. Applications read them at start-up using their IAM role, so nothing sensitive lives in AMIs, code or user data. Standard parameters have no storage charge; advanced parameters and higher throughput are billed. For automatic rotation of database passwords, Secrets Manager is the better fit. The KMS encryption guide covers the keys behind SecureString.

Inventory and compliance

Inventory collects installed applications, packages, network settings and Windows updates from managed nodes. Combined with Patch Manager compliance and AWS Config, it answers questions like “which servers still run an old OpenSSL” in minutes. Security Hub CSPM also checks whether instances are managed by Systems Manager; the GuardDuty and Security Hub guide explains those findings.

When an instance does not appear

  • Agent not installed or not running: check the service on the instance.
  • No IAM role, or the role lacks AmazonSSMManagedInstanceCore.
  • No outbound route to Systems Manager: add a NAT gateway or the three interface endpoints.
  • Instance metadata service blocked, so the agent cannot get credentials.
  • Wrong Region selected in the console.

Systems Manager checklist

  • Every instance shows as a managed node in Fleet Manager.
  • Patch baseline and schedule set; compliance reviewed monthly.
  • SSH ports closed; Session Manager used with logging.
  • Configuration and secrets moved into Parameter Store.
  • Inventory enabled for audits.

Bringing servers under Systems Manager is one of the first jobs after a handover, because it lets you audit and patch everything at once. The details listed with each AWS account show which Regions and limits you will be working with.

Systems Manager questions

Does AWS Systems Manager cost money?

Many core features for EC2, including Session Manager, Run Command, Patch Manager, Inventory and standard Parameter Store parameters, have no additional charge. Advanced parameters, some automation and on-premises advanced instances are billed.

Why does my instance not appear in Fleet Manager?

Usually the SSM Agent is missing or stopped, the instance has no IAM role with AmazonSSMManagedInstanceCore, or it cannot reach the Systems Manager endpoints through the internet, a NAT gateway or VPC endpoints.

Is the SSM Agent preinstalled?

It is preinstalled on many AWS-provided AMIs, including Amazon Linux 2023, recent Ubuntu Server and Windows Server images. Other images may need it installed manually.

Can Patch Manager reboot my servers?

Yes. The default patch operation reboots if needed after installing patches. Schedule patching in a maintenance window and patch instances in batches behind a load balancer to avoid downtime.

Parameter Store or Secrets Manager?

Parameter Store SecureString parameters work well for simple configuration and secrets at low or no cost. Secrets Manager adds automatic rotation and cross-account sharing for a per-secret monthly fee, which suits database credentials.

Editorial guide by Mark Biden · Reviewed 24 November 2026. Official sources are linked beside the relevant sections; AWS features, quotas and prices change, so confirm details in the AWS console before relying on them.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *