Integration Of AWS Auto Scaling With Application Load Balancer: A Step-By-Step
Step 1: Login to AWS Console: Go to the AWS Management Console and log in to your AWS account.
Step 2: Navigate to EC2 Console under elastic load balancer, Firstly Create Load Balancer
Step 3: Create Application Load Balancer Enter Details like load balancer name.
- The following Screenshots illustrates on the basic configuration of load balancer.
- Select Default VPC or you can select your own created one and at least two availability zones.
- Select Default Security Group or Either You select your own created.
Step 4: Click on Create Target Group in Listeners and routing here we have to choose target group our targets are instances so keep it as default.
- Enter Target Name and keep other options as default selected
- In the Health Checks enter Health Check Path as /index.html as we are going to test our auto scaling on this file and click on next and after keep register targets blank and click on create target group.
Step 5: Select The Target Group we created while creating load balancer Other keep it default and click on create load balancer.
Step 6: Navigate to Launch Templates in EC2 and click on create launch templates Enter template name and definitions.
- In Application and Operating System Images select your desired AMI (Amazon Machine Image) here we have selected Redhat.
- Select Instance Type and its Key pair.
- In Network Settings Select the subnet in which template launch instances (Make sure it will same as Load Balancer’s Subnet) and Security Group.
- Under Advance Details, In user data paste the following the script to test our auto scaled application load balancer and click on create launch template.
#!/bin/bash
yum install httpd -y
service httpd start
chkconfig httpd on
mkdir /var/www/html
Step 7: Select your earlier created launch template and under Actions tab click on create auto scaling group.
- Enter Auto Scaling Name and Select the launch template we have created and click on next.
- In the next step, select the VPC and Availability Zones (Same as Application Load Balancer.
- In the Configure advance options select the existing load balancer and select its target group.
- In the Health Checks Turn on Elastic Load Balancing health checks and click on next.
- In Configure group size and scaling tab select your desired capacities on what auto scale group should be scaled out or scaled in.
- Keep the default and click on next skip the notifications and tags as they are optional and In review make sure you selected all the correct options and click on Create Auto Scaling Group.
- Adding Notifications and tags to the instance.
Step 8: Auto Scaling Group will launch the instances based on desired capacity you can see in below image launched instances
Step 8: Go to Elastic Application Load Balancer in that select our application load balancer and copy the DNS name of it
Note: Modify the Default Security Group by editing inbound rules and in that adding HTTP protocal with myip or 0.0.0.0/0.
Step 9: Paste this DNS name in new tab of browser and press Enter you will see that static web page showing following message means that we have successfully integrated the auto scaling with our application load balancer
How To Integrate AWS Auto Scaling With Application Load Balancer?
On learning how to bring efficiency to your AWS infrastructure will enhance the workflow and cost management. In this article, we will guide you on integrating AWS Auto Scaling and Application Load Balancer. Exploring the seamless setup process, empowering your applications to effortlessly scale based on demand. Enhancing your cloud architecture for optimal performance and resource utilization.