Elastic Load Balancing (ELB)

Elastic Load Balancing (ELB)

Compute Fundamentals for AWS offers you an updated introduction to AWS's cornerstone compute services, and provides a foundation as you build your compute skills for AWS. It includes coverage of:

- Amazon Elastic Compute Cloud (EC2)
- Elastic Load Balancers (ELBs)
- Auto Scaling
- Amazon EC2 Container Registry and Services (ECR and ECS)
- AWS Elastic Beanstalk
- AWS Lambda

Do you have questions on this course? Contact our cloud experts in our community forum.


The Elastic Load Balancer, ELB, service is a software load balancer that is configured by you but managed by AWS. It is an integral part of building a fault-tolerant, highly available system. With IPv4 and IPv6 support, it can meet the needs of most use cases involving TCP, HTTP, HTTPS, and SSL connections. This lesson will only scratch the surface of the ELB service.

When an Elastic Load Balancer receives a request, it will route the request using an algorithm based on the type of connection. ELBs can either be a public-facing load balancer or an internal load balancer. The common scenario is that you can place your web tier behind a public ELB, and then have an internal load balancer between the web and application tier, which is only accessible by the service in the web tier.

To configure an ELB from the EC2 dashboard in the navigation pane and the load balancing, click on Load Balancer, and then click on Create Load Balancer. From here, we need to give our load balancer a unique name. We will call it "Demo-ELB", and then we will select from "Create LB inside the appropriate network." As you can see, we have the default VPC, and as we want to choose the subnets we will place a checkmark in the Enable Advanced VPC Configuration box. Working down the page, we can specify any additional listeners that we want to configure. But for our purposes we'll just accept the default of HTTP, and then our subnets by clicking the icon in the Action column, and then click Next, Assign Security Groups.

Now, we need to assign a security group to our load balancer that will allow inbound traffic to the ports that we previously specified. In our case, you will recall that that's just Port 80 for HTTP traffic. We will select the Create a New Security Group, and then configure it to allow traffic to Port 80 from anywhere, and then click Next, Configure Security Settings.

For Configure Security Settings, as we are only assigning a basic load balancer, we can skip over this step and click Next, Configure Health Check. ELB automatically checks the health of the EC2 instances for your load balancer by performing periodic health checks, which we will configure on this page. When an EC2 instance passes the health check threshold, it is assigned a status of "in service" and traffic is directed to it. However, if the instance fails, it is then assigned a status of "out of service" status and traffic is diverted away from it. Later, we will discuss auto-scaling groups, and when using these with ELB if we use the ELB health check as part of the decision tree and whether or not to launch a new instance if the healthy instance count drops below the configured desired number. We will leave the field set to the default values, and then click Next, Add EC2 Instances.

We now need to register our instances with the load balancer. If you haven't configured any instances at present, you can move on with the process and at a later stage you can add instances to the load balancer. Once we have added our instances, we will check Next, Add Tags, and we will just continue and click Next, Review and Create. Once you have reviewed the settings and confirmed that these are correct, click Create to create your load balancer, and when you are notified it is being created click Close.

In the bottom pane of the load balancer that you have just created, go to Status, which may indicate that some of the instances are not in service, which is more than likely due to them still going through the registration process. Once we have at least one instance in service, we can check that our load balancer is working by copying the string from the DNS name field and entering this into our web browser. Pricing for an Elastic Load Balancer is determined by the number of hours or partial hours the ELB is in use, and per gig of data processed by the ELB. The per hour and per gigabyte price is determined by the region the ELB is running in, and for latest pricing please check out the AWS website.
As mentioned in the overview, this lesson has only scratched the surface of the Elastic Load Balancer service, as there are other topics such as sticky sessions, SSL offloading that you need to understand to take full advantage of this service.

About the Author
Learning Paths

David's acknowledged hands on experience in the IT industry has seen him speak at international conferences, operate in presales environments and conduct actual design and delivery services.

David also has extensive experience in delivery operations. David has worked in the financial, mining, state government, federal government and public sectors across Asia Pacific and the US