Name :SG-WebServerASGInbound Rules :- SSH :Anywhere (IPv4)- HTTP :Anywhere (IPv4)- HTTPS :Anywhere (IPv4)Outbound Rules :- All Trafic :Anywhere (IPv4)
Create new SG for AWS EFS
Name :SG-EFS-LabASGInbound Rules :- NFS :Custom (SG-WebServerASG)Outbound Rules :- All Trafic :Anywhere (IPv4)
Create and Configure AWS EFS
Search and Create EFS Service
Name :EFS-LabASG"Customize"##On the 1st slide, immediately click "Next"####Delete sg-default then change it to SG-EFSLabASG do it in all AZ##Security Groups :SG-EFSLabASG
Get EFS mount script
Attach
Copy & paste attach script to notepad
##Using the EFS mount helper:##sudomount-tefs-otlsfs-012f18432a9d388f8:/efs##Using the NFS client:##sudomount-tnfs4-onfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvportfs-012f18432a9d388f8.efs.us-east-1.amazonaws.com:/efs
Create a New EC2
Name :EC2-For-ASG(Ubuntu)OS : Ubuntu22.04 (t2.small)Keypair : vockeySecurity Group : Select exiting security group "SG-WebServerASG"Storage : 10GB
LaunchTemplateName:LT-WebServerASGTemplateversiondescription:AtemplateforrunningASGaplicationMyAMI:#Owned by me : AMI-For-WebServer-ASGKeypair:vockeySecurityGroup:#Selecting exiting security group : SG-WebServerASG#Advance Detail##**Script for User Data**##!/bin/bashsudomount-tefs-o<efs-address>://var/www/htmlsudogitclonehttps://github.com/abdullahalfz18/default-apache2-on-ubuntu.git/var/www/htmlsudosystemctlrestartapache2
Load Balancer Type : Aplication Load BalancerLoad Balancer name :ELB-LabASGMappings : Checklist for all availability zoneSecurity Group :SG-WebServerASGListener and Routing :TG-For-ELBLabASG
Copy and save DNS ELB : ELB-LabASG-699876940.us-east-1.elb.amazonaws.com