AWS Classroom Series – 23/Oct/2021

AWS Systems Manager

  • AWS Systems Manager is an AWS Service that can be used to view and control infrastructure.
  • Lab:
    • Create the following ec2 instances
      • Ubuntu 20.04
      • Redhat 8
      • Windows 2019 Datacenter
    • Add a common tag to all the ec2 instances
      • env => QA
  • Navigate to Systems Manager
  • Creating IAM Instance Profile For Systems Manager
    • Navigate to IAM Refer Here
    • Now attach this IAM policy to all the three ec2 instances
  • Now try to use run command
  • Run the following shell script
#!/bin/bash
sudo apt update
sudo apt install apache2 stress -y
sudo apt install php libapache2-mod-php php-mysql -y
echo "<?php phpinfo(); ?>" | sudo tee /var/www/html/info.php
sudo service apache2 restart

  • AWS Systems Manager working process
    • Ec2 instance needs to have ssm agent installed to work with systems manager Refer Here
  • Lets try to manually install SSM agent on RedHat Linux Refer Here
  • Run command with RHEL
#!/bin/bash
sudo dnf install httpd -y
sudo systemctl enable httpd
sudo systemctl start httpd

  • Now lets use the Run Command on Windows EC2
    • Windows 2019 already has ssm preinstalled if you are using ami with ssm not installed Refer Here
    • The Powershell command is Install-WindowsFeature -name Web-Server -IncludeManagementTools

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%