APPLICATION LOAD BALANCER FOR THE VPC
Step 1 : First create a VPC
Fill the required details like name tag , IPV4 CIDR as "10.0.0.0/16" and click create VPC
Public subnet 1 and 2
STEP 4 : Create a NAT Gateway
Fill the details name , give the subnet as "public 1" and allocate elastic IP
routes and In subnet associations choose edit and give your public subnets , click save changes.
Add route and give target to your "Internet gateway"
In subnet associations choose edit and give your 2 private subnets , click save changes.
In NAT route table ,Choose edit routes and give target as "NAT gateway" address
add this
#!/bin/bash
yum install httpd -y
systemctl enable httpd
echo “<h1>This is instance 2</h1>” >/var/www/html/index.html
systemctl start httpd
Create another instance with different private subnet. Select the same security group that was previously created for the first instance.
STEP 7:Create a application load balancer
create a target groups and choose two instaces then click include as pending below and click register target groups
Choose the target group created in the load balancer tab. Then click on create Load balancer.
Navigate to the ec-2 to security group that was created earlier and edit the inbound rules. Add the load balancer security group which was created for the load balancer.
Then to tareget groups and see the status as "helathy" and then open load balancer copy the dns paste in the website
Comments
Post a Comment