https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html
Follow this link to create key pair in .pem file.
explorer.exe .
in WSL to open folder.chmod 0400 <NameOfKeyPair.pem>
chmod 0400 EC2Tutorial.pem
ssh -i <NameOfKeyPair.pem> <InstanceUserame>@<PublicIPv4>
ssh i EC2Tutorial.pem ec2-user@52.40.154.239
-i
means identity fileCtrl C
Ctrl D
#!/bin/bash
#########################################
# Use this for launching Amazon Linux 2 #
#########################################
# get admin privileges
sudo su
# install httpd (Linus 2 version)
yum update -y
yum install -y httpd.x86_64
systemctl start httpd.service
systemctl enable httpd.service
echo "Hello World from $(hostname -f)" > /var/www/html/index.html
3 Types of load balancers:
Cross-Zone Load Balancing: balance load across multiple AZs
Connection Draining: stop sending new requests to the instance which is deregistering (removing from ELB)
Auto Scaling Group (ASG):