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

- env => QA
- Create the following ec2 instances
- 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
- Navigate to IAM Refer Here
- 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

- 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

- Windows 2019 already has ssm preinstalled if you are using ami with ssm not installed Refer Here
