AWS Builder Center

AWS Systems Manager: Managing EC2 Servers

Learn how AWS Systems Manager helps manage EC2 servers using Session Manager, Run Command, automation, patching, and Parameter Store.

Series: My 90-Day AWS & DevOps Learning Journey (30 articles)

  1. …
  2. 13
    AWS Systems Manager: Managing EC2 Servers This article
# AWS Systems Manager: Managing EC2 Servers
Managing one EC2 instance is relatively simple. But imagine having dozens or hundreds of servers running across different environments.
Connecting to each server manually, checking configurations, installing updates, and troubleshooting problems can become time-consuming.
This is where **AWS Systems Manager** can help.
## What Is AWS Systems Manager?
AWS Systems Manager is an AWS service that helps you manage and operate your AWS resources and applications.
It provides tools for tasks such as:
* Managing EC2 instances
* Running commands remotely
* Viewing operational information
* Automating administrative tasks
* Managing software and patches
* Storing configuration parameters
* Troubleshooting servers
For DevOps engineers, Systems Manager can reduce the need to manually connect to individual servers.
## Systems Manager and EC2
One common use case is managing EC2 instances.
For example, imagine having:
```text
EC2-1
EC2-2
EC2-3
EC2-4
EC2-5
```
Instead of connecting to every server separately, Systems Manager can help perform management tasks across multiple managed instances.
A simplified workflow looks like:
```text
DevOps Engineer
↓
Systems Manager
↓
EC2 Instances
↓ ↓ ↓
EC2 EC2 EC2
```
This becomes increasingly useful as the number of servers grows.
## Session Manager
One of the useful Systems Manager capabilities is **Session Manager**.
Session Manager provides interactive access to managed EC2 instances without requiring you to open inbound SSH ports in the traditional way.
A simplified workflow is:
```text
Engineer
↓
Session Manager
↓
EC2 Instance
```
This can simplify server access and reduce the need to expose management ports to the internet.
For example, instead of directly connecting to an EC2 instance over SSH from your laptop, you can use Session Manager when the instance and IAM configuration meet the required conditions.
## Run Command
**Run Command** allows administrators and engineers to execute commands on managed instances.
For example, suppose you need to check disk usage on multiple Linux servers.
Instead of connecting individually:
```text
Server 1 → Check
Server 2 → Check
Server 3 → Check
Server 4 → Check
```
you can use Systems Manager to run a command across selected instances.
For example:
```bash
df -h
```
This can save time when managing multiple servers.
## Patch Manager
Keeping servers updated is an important part of system administration.
Systems Manager provides **Patch Manager** capabilities that can help organizations manage operating system patches for supported managed nodes.
A simplified workflow is:
```text
Servers
↓
Patch Management
↓
Check Updates
↓
Apply Required Patches
```
Organizations can define their patching approach according to their operational requirements.
Regular patch management can help reduce security and maintenance risks.
## Automation
Systems Manager also provides automation capabilities.
Instead of performing repetitive administrative tasks manually, automation documents can help execute predefined workflows.
For example:
```text
Trigger
↓
Systems Manager Automation
↓
Perform Tasks
↓
Complete Workflow
```
This is an important concept for DevOps because automation reduces repetitive manual work.
## Parameter Store
Another useful capability is **Parameter Store**.
Parameter Store can store configuration values and parameters that applications or automation workflows need.
For example:
```text
Parameter Name:
database-host
Parameter Value:
db.example.internal
```
Applications can retrieve configuration values when needed instead of hard-coding them directly into application code.
Parameter Store supports different parameter types, including secure string parameters.
Sensitive information should still be managed according to AWS security best practices and the requirements of the application.
## Systems Manager and IAM
IAM is important when using Systems Manager.
IAM permissions determine which users and roles can perform Systems Manager actions.
For example:
```text
IAM Role
↓
Permissions
↓
Systems Manager
↓
EC2 Instance
```
This follows the principle of giving users and services only the permissions they need.
Understanding IAM before using Systems Manager is therefore very useful.
## Systems Manager and DevOps
Systems Manager fits naturally into DevOps workflows.
For example:
```text
Developer
↓
Git Repository
↓
CI/CD Pipeline
↓
Deployment
↓
EC2
↓
Systems Manager
↓
Management & Monitoring
```
A DevOps engineer can use automation tools alongside Systems Manager to manage infrastructure and application environments.
This helps move away from repetitive manual server administration.
## Systems Manager vs SSH
A common question for beginners is:
**Why use Systems Manager instead of SSH?**
SSH is still widely used, but Session Manager provides another approach for accessing managed instances.
Traditional approach:
```text
Laptop
↓
Internet
↓
SSH
↓
EC2
```
Session Manager approach:
```text
Laptop
↓
Systems Manager
↓
EC2
```
The exact architecture depends on the AWS environment and configuration.
Session Manager can be particularly useful when organizations want to avoid exposing SSH management access publicly.
## A Simple Example
Imagine a company has 20 EC2 instances running a web application.
A new configuration needs to be checked across all servers.
Without centralized management, an engineer might have to connect to each server individually.
With Systems Manager:
```text
Systems Manager
↓
Select Managed Instances
↓
Run Command
↓
Execute Task
↓
Collect Results
```
This can make routine operational work much more efficient.
## Why Systems Manager Matters for DevOps
DevOps is not only about writing code and creating CI/CD pipelines.
It also involves operating infrastructure efficiently.
Systems Manager introduces several important DevOps concepts:
* Automation
* Remote management
* Configuration management
* Patch management
* Secure server access
* Operational visibility
* Reduced manual work
These concepts become increasingly important when managing larger cloud environments.
## Key Takeaways
The important concepts to remember are:
* **Systems Manager** helps manage AWS resources and applications.
* **Session Manager** provides interactive access to managed instances.
* **Run Command** can execute commands on managed instances.
* **Patch Manager** helps manage operating system patches.
* **Automation** can execute predefined operational workflows.
* **Parameter Store** can store configuration parameters.
* **IAM** controls access to Systems Manager features.
* Systems Manager can reduce repetitive manual server administration.
As I continue learning AWS and DevOps, I'm learning that managing servers efficiently is just as important as creating them. **Automation and centralized management are key parts of modern DevOps.**

Series: My 90-Day AWS & DevOps Learning Journey (30 articles)

  1. …
  2. 13
    AWS Systems Manager: Managing EC2 Servers This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article