Note: To remove the infrastructure that you have created, just re-run the script and it will prompt you for destroying the infra that you created. Infra that already exists(not created by the script) cannot be destroyed by the script.
- Clone the VPC branch of the AutoScaling repo in micky.
git clone -b vpc https://mgtsys:[email protected]/mgtsys/AutoScaling.git ~/AutoScaling/vpc
- Now execute the vpc.sh script to create the VPC.
cd /home/mgt/AutoScaling/vpc && bash vpc.sh
-
You will be asked to enter the following details.
- Enter your AWS ACCESS KEY:
- Enter your AWS SECRET KEY:
- Enter your AWS Region:
- Enter your Project Name:
-
The script will create the Following resources.
- VPC
- Subnets [Public, Private]
- Internet Gateway
- NAT Gateway
- Route Table [Public, Private]
-
Wait for the script to complete.
-
Now, launch the instance from MGT Backend in the newly created VPC and proceed with setting up Admin and WebMaster servers.
IMPORTANT: Make sure your instances are named in the following format Admin = "$projectname-admin"
WebMaster = "$projectname-web-master"
It is important for the script to detect the names in mentioned format to fetch the properties.
- Once the servers are up and running, you can proceed with the cloning the ASG branch of the AutoScaling repo in micky.
git clone -b asg https://mgtsys:[email protected]/mgtsys/AutoScaling.git ~/AutoScaling/asg
- Now execute the asg.sh script to create the ASG.
cd /home/mgt/AutoScaling/asg && bash asg.sh
-
You will be asked to enter the same details as you did in step 3.
-
The script will create the following resources.
- AMI
- Load Balancer
- Target Groups
- Security Group
- Health Check
- Launch Configuration
- Auto Scaling Group
- CloudWatch Alarm
-
Wait for the script to complete.