AWS Systems Manager

Hands-On

Demo

Agenda

In the Demo, we will

  1. Create an EC2 Instance Profile Role for Systems Manager
  2. Create an EC2 Instance
  3. Run Systems Manager Run Command
  4. Explore all the Different Features offered by Systems Manager

Create Systems Manager Role for EC2

Create IAM role

AmazonSSMManagedInstanceCore

Add permissions

SSMInstanceRole

Name

Create role

Create an EC2 Instance

Systems-Manager-Demo

Assign Instance Profile Role

AWS Systems Manager Run Command

AWS-RunShellScript

Target selection

echo "Hello from Systems Manager Run Command!"

Run 

Command Status

View output

#!/bin/bash
echo "Hostname: $(hostname)"
echo "Operating System: $(cat /etc/os-release | grep PRETTY_NAME | cut -d'"' -f2)"
echo "CPU Info: $(lscpu | grep 'Model name' | cut -d':' -f2 | xargs)"
echo "Total Memory: $(free -h | awk '/^Mem:/ {print $2}')"
echo "Disk Usage: $(df -h / | awk 'NR==2 {print $5}')"

Another Command

Target selection

Command status

Command Output

Automation

Fleet Manager

Start terminal sension

Run Interactive command

Parameter Store

config-parameter-1
/usr/app-folder/app-config.yaml

Inventory

State Manager

sudo systemctl status amazon-ssm-agent
sudo systemctl stop amazon-ssm-agent
sudo yum remove amazon-ssm-agent
sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
sudo systemctl enable amazon-ssm-agent
sudo systemctl start amazon-ssm-agent
sudo systemctl status amazon-ssm-agent

Install SSM Agent

Clean Up

  1. Delete the EC2 Instance
  2. Delete the EC2 Instance Profile Role
  3. Delete the Systems Manager Parameter Store Parameter

🙏

Thanks

for

Watching