100 Days of AWS — Day 20- AWS System Manager — Part 1

  1. Setting up IAM Role for System Manager
  • Give your role some meaningful name and click on Create role
  • Choose the IAM Role, you have create in previous step and click on Save.
$ cat /etc/os-releaseNAME="Amazon Linux"VERSION="2"
  • To verify it
$ rpm -qa|grep -i ssmamazon-ssm-agent-3.1.1188.0-1.amzn2.x86_64
  • In order to install the agent on Centos/RedHat run the below command
sudo yum install -y https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm
  • Under Node Management → Run Command → Run a Command
  • Under Run a command, select AWS-RunShellScript, under Commands (ls -l ) and under Choose Instances Manually. Click on Run
  • If the command is executed successfully, you will see the Overall status as Success.
  • Click on the instance and check the output
  • You can execute the same command via AWS cli
$ aws ssm send-command --document-name "AWS-RunShellScript" --parameters commands=["ls -l"] --targets "Key=instanceids,Values=<instance id"
  • In the next tab
  • Give you inventory some name
    * Targets: Either Manually select the instance or better to use Tag so that all the future installed instance will be tracked automatically
    * Schedule: How frequently you want to collect Inventory
    * Parameter: Different Parameter you want to collect
  • After waiting for few min, you will see something like this

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store