
Day 39: AWS Systems Manager – Session Manager, Parameter Store, Run Command, and Patch Manager
Day 39 of my 90-day AWS challenge: how AWS Systems Manager lets me connect to servers without SSH keys, store configuration and secrets in Parameter Store, run commands across many instances, and keep them patched.
Recap of Day 38
This week I've been hosting applications on Beanstalk, ECS, and Amplify. Once applications are running, someone has to operate them: log in to servers, change settings, run scripts, and apply patches. AWS Systems Manager (SSM) is the operations hub that does this without opening risky doors.
What is Systems Manager?
Systems Manager is a collection of tools for viewing and controlling AWS resources, mostly EC2 instances, in one place. The tools all rely on the SSM Agent, a small program that runs on the instance and talks to the service. It comes preinstalled on many Amazon Linux AMIs.
Key capabilities
Capability | What it does |
|---|---|
Session Manager | Opens a shell on an instance from the console or CLI, with no SSH keys and no open inbound ports |
Run Command | Runs a command or script on one instance or many at once |
Parameter Store | Stores configuration values and secrets in a hierarchy |
Patch Manager | Scans for missing patches and installs them on a schedule |
State Manager | Keeps instances in a desired configuration |
Automation | Runs step-by-step runbooks for common operations tasks |
Inventory | Collects details about installed software and instance settings |
Fleet Manager | A console view to manage servers, such as browsing files |
Session Manager
On Day 3 I connected to a server with an SSH key pair, which required port 22 to be open. Session Manager removes both requirements:
- Access is controlled with IAM (Day 2), not shared keys
- No inbound ports need to be open in the security group (Day 5)
- Every session can be logged to CloudTrail, CloudWatch Logs, or S3
What it needs:
- The SSM Agent running on the instance
- An instance profile (IAM role) with the
AmazonSSMManagedInstanceCoremanaged policy
- A network path to the Systems Manager service, through the internet, a NAT gateway, or VPC endpoints in a private subnet
Connecting from the CLI needs the Session Manager plugin installed:
aws ssm start-session --target i-0123456789abcdef0Run Command
Run a command on every instance that has a tag, without logging in to any of them:
aws ssm send-command \
--document-name "AWS-RunShellScript" \
--targets "Key=tag:Env,Values=dev" \
--parameters 'commands=["uptime"]'The output for each instance is stored and can be viewed in the console.
Parameter Store
Parameter Store is a hierarchical store for configuration data and secrets, with a free standard tier.
Type | Use it for |
|---|---|
String | Plain settings such as a URL |
StringList | Comma-separated values |
SecureString | Secrets, encrypted with KMS (Day 19) |
A hierarchy keeps things organized, for example
/myapp/dev/db-url and /myapp/prod/db-url . IAM policies can grant access to a whole path.aws ssm put-parameter --name "/myapp/dev/db-url" --value "<jdbc-url>" --type String
aws ssm put-parameter --name "/myapp/dev/db-password" --value "<password>" --type SecureString
aws ssm get-parameter --name "/myapp/dev/db-password" --with-decryptionThe values in angle brackets are placeholders, and real secrets should never be typed into notes or code. Parameters are versioned, and Spring Cloud AWS can load them into a Java application at startup.
Parameter Store vs. Secrets Manager
| Parameter Store | Secrets Manager (Day 19) |
|---|---|---|
Best for | Configuration and simple secrets | Credentials that need rotation |
Automatic rotation | No built-in rotation | Yes, with native RDS support |
Cost | Standard parameters are free | Per secret per month |
Patch Manager
- A patch baseline defines which patches are approved
- A maintenance window says when patching may happen
- Patch Manager scans instances, installs missing patches, and reports compliance
This is part of the shared responsibility model from Day 1: keeping the operating system patched is the customer's job on EC2.
Cost
Many Systems Manager capabilities are available at no extra charge for EC2 instances, including Session Manager, Run Command, and basic Parameter Store use. Some features, such as advanced parameters, certain Automation steps, and managing on-premises servers, cost money, so check the pricing page.
How it connects to earlier days
- Day 2 and 3: IAM roles and instance profiles replace key pairs for access
- Day 5: security groups can stay closed to inbound traffic
- Day 19: SecureString parameters use KMS, and Secrets Manager remains the choice for rotation
- Day 20: CloudTrail records who started sessions and ran commands
- Day 36 and 37: application settings for Beanstalk and ECS can come from Parameter Store
What I practiced today
- Attached the managed SSM policy to an instance role and launched a small EC2 instance
- Connected with Session Manager from the console and ran a few commands
- Created a String and a SecureString parameter and read them with the CLI
- Ran
uptimeon a tagged instance with Run Command
- Looked at the default patch baseline
- Deleted the parameters and terminated the instance afterwards
Key takeaways
- Session Manager gives auditable shell access without SSH keys or open ports
- Use Parameter Store for configuration, and a SecureString when a value is secret
- Run Command and Patch Manager make fleets manageable without logging in to each server
- Never type real passwords into notes or code, and delete practice parameters and instances
Up next: Day 40
AWS Organizations and IAM Identity Center: managing multiple accounts and people.
Learning AWS too? Follow along and share what you're building. #90DaysOfAWS
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article