Lesson 3 of 4 Infrastructure Automation

Operating Fleets with AWS Systems Manager

This lesson explains how AWS Systems Manager operates fleets of EC2 instances and on-premises servers at scale, access, patching, configuration, automation and inventory, without SSH or bastion hosts.

Learning outcomes

After completing this lesson, you will be able to:

  • Identify Systems Manager capabilities.
  • Identify the requirements for managed nodes.
  • Recognise when Systems Manager is the answer.

Capabilities

AWS Systems Manager is a collection of capabilities for operating instances and servers at scale, all using the SSM Agent. Session Manager opens a logged shell on an instance without SSH keys, open inbound ports or bastion hosts. Run Command runs a script across many instances, selected by tag. Patch Manager patches instances automatically against patch baselines during maintenance windows. Parameter Store holds configuration and secrets.

Automation runs runbooks for operational tasks, such as remediating a problem or creating an AMI. State Manager keeps instances in a defined configuration by reapplying it on a schedule. Inventory and Fleet Manager show installed software and manage the fleet, and Quick Setup applies common settings across an organisation. The following table summarises the capabilities.

CapabilityUse
Session ManagerLogged shell access without SSH, inbound ports or bastions
Run CommandRun scripts across fleets by tag
Patch ManagerAutomated patching against patch baselines, in maintenance windows
Parameter StoreConfiguration and secrets
AutomationRunbooks for remediation, AMI creation and operational tasks
State ManagerKeep instances in a defined configuration
Inventory and Fleet ManagerSoftware inventory and fleet management
Quick SetupCommon settings across an organisation

The following diagram compares shell access through a bastion with Session Manager.

Shell access with and without Systems Manager. A bastion host needs SSH keys, an open inbound port and a public instance to manage. Session Manager opens a logged shell through the SSM Agent, which connects outbound, so the instance needs no inbound ports, keys or bastion.
Session Manager requires the SSM Agent and an instance role that allows Systems Manager.
Match the pairs

Systems Manager capabilities

Exam skills 2.2.1 · 1.2.1

Match each requirement with the Systems Manager capability that meets it.

Log in to try this activity Interactive activities are free with an account.

Requirements

Systems Manager can manage only nodes that meet three requirements. Each instance needs the SSM Agent, which is preinstalled on many AWS-provided AMIs, and an instance profile with the AmazonSSMManagedInstanceCore policy, which lets the agent communicate with Systems Manager.

The agent also needs network access to the Systems Manager endpoints, either through a NAT gateway or through interface VPC endpoints for SSM, SSM Messages and EC2 Messages in private subnets. On-premises servers can be managed too, by registering them as hybrid managed nodes with an activation.

In architecture questions

Systems Manager is the answer for operating instances without opening ports, patching on a schedule, running commands across many servers, and automated remediation triggered by Config rules or EventBridge.

Worked example

Managing a fleet without SSH

An operations team manages 200 EC2 instances. It must patch them monthly, run a configuration command on all of them, and give engineers shell access, without opening port 22.

NeedSystems Manager capability
Monthly patching in a maintenance windowPatch Manager
Run a command on all instances tagged Env=prodRun Command
Shell access without SSH keys or open ports, fully loggedSession Manager
Store configuration valuesParameter Store

Each instance needs the SSM Agent, an instance profile with AmazonSSMManagedInstanceCore, and a network path to Systems Manager. A small team deploying a web application without managing servers at all would choose Elastic Beanstalk instead.

Check yourself

What must an EC2 instance have to be managed by Systems Manager?

Show answer

The SSM Agent, an instance profile with permissions such as AmazonSSMManagedInstanceCore, and a network path to the Systems Manager endpoints.

Exam Tips

Remember for the exam

  • To patch a fleet of instances automatically, use Systems Manager Patch Manager.
  • For secure shell access without opening port 22, use Session Manager.
  • To patch instances during defined hours, use Patch Manager with maintenance windows.
  • To run a script on hundreds of instances at once, use Run Command.
  • When instances do not appear in Systems Manager, check the agent, the instance profile and network access to the endpoints.