Creating Application Load Balancer in AWS

Published : 19. November 2020. |- Changed: 19. November 2020 | 0 results

Step-by-step procedure for creating a load balancer for web applications.

Create an application load balancer in AWS!

In this article we look at the steps needed to create an application load balancer and then perform some tests. ELB can also be used in Amazon ECS, but for this we use the following architecture, which manages web servers on EC2 instead of in containers It is a subset of our mail order business…

Model ALB

We have 2 EC2 instances running the Apache web server on 2 different public subnets. The Application Load Balancer receives data traffic from the internet and forwards it to the EC2 instances of the backend.

Let’s dive into the process of creating an ALB –

  • Enter the EC2 Dashboard
  • In the left navigation bar, click on Load Balancers in the Load Balancing section.
  • On the page Load Balancer click Create Load Balancer.
  • You should see the load-balancer wizard –

Selecting a load balancer

Here you have to select the type of load balancer you want to create:

  1. Application Load Balancer : For load balancing of HTTP, HTTPS web traffic.
  2. System Load Balancing : For load balancing of TCP, TLS and UDP network traffic
  3. Balancing the bridge tax : For balancing the data traffic load of virtual devices via GENEVA
  4. Conventional load balancer : An old ELB technician.

Click the Create button under the Load Balancer application to continue. The Load Balancer Wizard should open.

Basic configuration of the ALB

Fill in the data –

  • Name: Name of the ALB
  • Regime: Choose a web-like interface while we customize the web load balancer.
  • Type of IP address : Select the type of addressing
  • Listeners: Select HTTP with port 80. If your request goes to HTTPS, select it accordingly.

Configuration ALB AZ

  • MAIL ORDER: Select the PVC under which the ALB is to be used.
  • Available Areas : Select a minimum of 2 for AP. When you create an Internet-related ALB, the subnets must have a route to the Internet gateway, which means they must be public subnets. You can select only one subnetwork per AZ.
  • AWS Global Accelerator : For the performance. This is part of the integrated service and can be changed at a later date.
  • The buzzwords: Mark.
  • Click Next: Configure the Security Settings button at the end.

Since HTTP is selected in the basic configuration, a security warning should appear.

HTTP notification

Click the Next button again: Configure the Security settings button at the end to continue.


Create a new security group or select an existing one for ALB. Here we select an existing SG that enables HTTP traffic.

Click Next: Configure Routing button.

ALB Routing

In the Routing section we configure a target for an ALB. Here the ALB will know where to send the traffic as soon as they receive it. According to our plan, we will send the traffic to 2 EC2 copies.

  • Workgroup
    • The target group: Create new or use existing ones. This is a range of resources that serve as targets for ALB.
    • Name: for identification
    • Target type : In our case.
    • Protocol : HTTP or HTTP
    • The harbor: Depends on the port for listening to web applications. I use the standard web server to listen on port 80.
    • The version of the protocol : This also depends on the web application.
  • Health test
    • Protocol : ALB is used for health checks of the intended type.
    • The path: The ALB will follow this path by using the above protocol to determine a health or purpose.
  • Extended parameters for health testing
    • The harbor: Communication port for medical examinations.
    • Threshold for health : The number of consecutive medical examinations passed before an unhealthy target is considered healthy. Range 2-10.
    • Unhealthy threshold: The number of consecutive failed health checks to mark the target as unhealthy. Range 2-10.
    • Time-out: If no response is received within this time limit, mark the health check as unsuccessful. Range (2-120 s)
    • Interval: Time between medical examinations (5-300 sec)
    • The success codes: HTTP code that must be recalled to mark the success of the health check.

Click Next: Destination registration button.


As you can see, we have 2 copies of EC2, which work in different areas and can be registered as ALB targets. At the same time, make sure that the website is running properly in both cases.

Checking the web server

Our two web servers serve different websites (for later ALB tests). We have verified this with the government of EC2 Ip.

Now select the instances that control web traffic and click Add to Recording.

Registered target

Both destinations must be registered and included in a list of registered destinations. Highlight and click Next: The Browse button.

Overview of the ALB configuration

Check all configurations and click Create.

The preparation of the ALB is ready!

You should see the success message as described above.

Click on the Close button and you will be redirected to the Load balancing page. New application load balancers should be listed here, and they are usually in a redundant state. It should switch to Active within minutes once at least one target has passed a health check.

ALB Details

Once an ALB is active, take the DNS name from the detail view of the ALB and try to load it into your browser. It should fill the web pages with one of the objectives of EC2.

ALB Review

The small GIF above shows that the same DNS ALB downloads a web page from different internal targets. I have created separate web pages to define the differences and characteristics of the ALB. In the real world, it must go in the same direction through each of its internal objectives.

Let’s go, let’s go, let’s go, let’s go! We have created an application load balancer that controls the website from different internal servers!

Related Tags:

aws alb vs elb,alb aws az,aws alb across regions,enable the availability zone,application load balancer cloudformation,aws nlb availability zones,idle timeout aws alb,aws alb max connections,loadbalancer target group,aws application load balancer cloudformation,aws application load balancer ssl termination,aws nlb diagram,what is vpc load balancer?,nlb instance type,aws network load balancer example,aws ecs target group,aws alb internal vs external,aws elbv2 create-load-balancer,classic load balancer arn,elbv2 boto3,ecs target group cloudformation,please configure a container with elb.,aws fargate target groups,aws fargate load balancer,ecs cli load balancer,aws fargate ssl,elastic beanstalk port 5000,nlb elastic beanstalk,aws:elasticbeanstalk:environment,aws alb port forwarding,nlb for http,elastic beanstalk change load balancer type,aws elb timeout 504,aws network load balancer timeout,aws load balancer request limits,step 4: configure routing,http keep-alive option for your ec2 instances,aws load balancer tutorial,aws alb best practices,aws alb websockets,aws alb path rewrite,add instance to alb,application load balancer types,load balancer edureka,test network load balancer,aws alb preserve source ip,network load balancer cloudformation,elb interview questions,aws application load balancer tutorial,aws application load balancer private subnet,application load balancer aws,application load balancer aws pricing,application load balancer vs network load balancer,create load balancer aws,aws network load balancer