Skip to main content

CONFIGURING LOAD BALENCER WITH AUTOSCALING GROUP

Consider we have a auto scaling group running with three instances.Now we have to create a load balencer.

From ec2-dash board click on load balencer > Application Load Balencer >In configure load balencer give name,type and so on.Also we have to select vnet and subnets we want to add.Here we will add our all 3 sub nets since vm in our ASG are under 3 subnets.Click next. Now select our security group and click next.




 On configure Routing we have to specify our target group.we can select new target group and give name for it.Now select protocol which is HTTP, port 80, and target type as intance.Also select the path.we will keep it as / itself.Thenk click next.

Here we dont want to add any instance since we want to configure load balencer with ASG.Now click next and click create.



Wait for 10 minutes till our load balencer is ready.Now go to our auto scaling group.Click on edit.Under target group give the name of our target group which is asg-3ec2.








Now go to load balencer and acess by using load balencer dns url.

If you want to check whether traffic is distributed among 3 instances in ASG. We can change the index page in 3 instances and check again.