Table of Contents
ToggleWhat is AWS Systems Manager (SSM)?
AWS Systems Manager is a service that helps you manage all your servers from one place, whether they are in AWS, on-premises, or in other clouds. It has a single dashboard where you can view all your servers at once, spot issues like outdated software, and filter by factors such as operating system, AWS Region, or account.
For a server to work with Systems Manager, it must have the SSM Agent installed and connected. If it’s not connected, Systems Manager can automatically check for problems, like network errors, allowing your servers to become “managed” again.
AWS Systems Manager is a service in AWS that lets you easily view, manage, and operate your servers (called “nodes”), whether they are in AWS, in your on-premises data center, or in other cloud providers. It has a single, unified dashboard that brings together all the tools you need to manage your servers across different AWS accounts and Regions.
To work with Systems Manager, servers must be “managed nodes.” This means they need to have the latest SSM Agent installed and be able to communicate with the Systems Manager service. If a server doesn’t appear as managed, Systems Manager offers a one-click troubleshooting feature. This tool automatically checks for problems like network issues and can run fixes on a schedule you choose. It also provides suggestions and ready-to-use scripts to address these issues.
The SSM dashboard offers a quick overview of all your servers in one place. You can see details like which ones are running old operating systems. Additionally, you can filter the view based on factors such as operating system version, AWS Region, AWS account, or SSM Agent version. This makes it easy to find the exact information you need for a specific account, application, or your entire organization.
In this article, we will walk through how to setup and patch the servers using SSM step-by-step.
Set up patching in AWS Systems Manager
AWS Systems Manager helps to keep Windows and Linux machines up to date by automated patching. You can schedule patch jobs, apply updates at scale, and manage patching safely across many servers.
SSM lets you manage both your EC2 instances in AWS and servers inside your own network
Key features include:
- Automatic OS patching with Patch Manager – Keeps your servers up to date without manual effort.
- Session Manager – Securely access a server’s shell without needing SSH or RDP.
- Software inventory & discovery tools – See what software is installed and gather system details.
- Run Command – Run scripts or commands on remote servers without logging in.
Patch Manager allows to scan and apply patches for both Windows and Linux systems based on pre-defined rules and schedules.
Prerequisites:
Before proceed, following points need to check:
- SSM Agent is installed and running on all target instances
- IAM Role (for EC2) or IAM Managed Instance Role (for on-prem) is attached with “AmazonSSMManagedInstanceCore“ and AmazonEC2RoleforSSM permissions.
- Instances are registered as managed instances in AWS Systems Manager.
- Security Groups allow outbound access to Systems Manager endpoints or VPC Endpoints are configured for private subnets.
Step 1: Add Tags to Your Instances
aws ec2 create-tags --resources i-0123456789abcdef0 --tags Key=Environment,Value=Production
aws ec2 create-tags --resources "i-0123456789abcdef0" --tags "Key=Environment,Value=Production"
aws ec2 create-tags --resources i-0123456789abcdef0 --tags Key=Environment,Value=Production
Note: On Linux and macOS – Run directly in terminal. Make sure AWS CLI is installed and configured with AWS configure.
Step 2: Now configure Patch Baselines
- Then configure auto-approval rules (e.g., approve Critical patches after 6 days).
- Add specific patches if needed, save and optionally set it as default for the OS.
Step 3: Create a Patch Group
Step 4: Create a Maintenance Window to schedule patching during week-off or off-peak hours
Note : This is optional but recommended if we doesn’t have existing Maintenance Window available specially in new setup.
Step 5: Register Targets to Maintenance Window
Step 6: Register Task to Apply Patches
Step 7: Manually Scan and Patch (Optional)
aws ssm send-command --document-name "AWS-RunPatchBaseline" --targets "Key=tag:Patch Group,Values=ProdWindowsGroup" --parameters "Operation=Install" --comment "Manual Windows patching" --region us-east-1
aws ssm send-command --document-name "AWS-RunPatchBaseline" --targets "Key=tag:Patch Group,Values=ProdLinuxGroup" --parameters "Operation=Install" --comment "Manual Linux patching" --region us-east-1
Step 8: Patching Status Monitoring
aws ssm list-command-invocations --command-id <command-id> --details
aws ssm list-commands --max-items 5




