In this video, Jeff Winesett demonstrates creating and configuring a new AWS Elastic Load Balancer, ELB. The load balancer helps achieve high availability by balancing traffic across two AWS availability zones.
- [Instructor] The proposed system architecture has a load balancer to allow internet traffic to be distributed across multiple web servers, which will help the system achieve high availability. And because the security group that I associated with the instance that I launched does not provide access in from the public internet, but instead only from the load balancer, I need to create the load balancer. So here we are back at the console. You create load balancers again from the EC2 Service, so I'll get into the EC2 Service, and I'll go down here in the left menu under Load Balancing and click Load Balancers, and of course Create Load Balancer.
Now here I need to make the choice between an application load balancer and a classic load balancer. Amazon now has two types of elastic load balancing from which to choose, one they now call Classic, which is still compatible with the older EC2 classic environment discussed back in Chapter Seven, and a newer one called Application Load Balancing, which makes routing decisions at the application layer, and also allows for more options for handling traffic into the application servers.
Since this is exactly our use case, I'll choose this preferred option. I'll continue. Now I can give the load balancer a name. Let's call it exactly what it is, web-server-load-balancer. It is going to be internet-facing. I want to allow users from the internet to come in and hit the web server, and I'll stick with the IP address ipv4. And now I choose the listener protocols that the load balancer will allow in.
I certainly want to allow HTTP on port 80. I could also add another listener to allow HTTPS on traffic port 443. In choosing this, if I were to proceed, it's going to force me to choose a certificate with which to use, which is needed for SSL. AWS actually provides something pretty cool here. AWS has a certificate manager that makes it pretty easy to set up an SSL certificate for use on the load balancer. In doing so, you have to own the domain and verify the domain and do some of the normal steps that you have to take to get a security certificate in place, but it's all pretty easy.
It's a few clicks of the button and a few verifications and an email, so I'd certainly recommend setting this up. HTTPS is certainly important for web sites and web servers these days. I'm going to avoid that here in the interest of time, but I want you to be aware that AWS does provide some pretty easy steps to help you set up HTTPS on your web servers and your load balancers. Next I need to choose the availability zones that I want to balance load traffic across. We know that our system architecture has the load balancer balancing traffic across two availability zones.
And when the instance was created, I made sure to put the instance into Zone A so that I knew that I would be making at least that choice when I got to the load balancer section. So I definitely want it to balance traffic to Zone A, and I also need to choose at least one other availability zone, since I want this load balancer to balance traffic across two availability zones. I'll choose Zone B, which is consistent with the architecture we put forth at the beginning of this chapter. Finally, down here there's a section for our tags.
As I just mentioned, you can use tags on most any resource as you're creating them, and they're nice to have for future use. I'll at least give it a name, web-server-load-balancer. Might be a little redundant since we named it that to begin with, but tags are nice to have. It's also going to be in our test environment. And I like to add the cost-center tag to make sure that the marketing department, in this case, is going to pick up the bill.
Great. Next, on to security settings. Next I'm met with a warning that lets me know that the load balancer is not using a secure listener. So, it's sort of suggesting that I should use HTTPS protocol especially as I'm going to be putting this in the public internet for internet connection. I agree. As I mentioned, AWS does provide a certificate manager to help in this, so when you're setting up a real system, consider using HTTPS instead of a security certificate on the domain that you want to use for your web server.
For now, I'm going to go ahead and ignore this warning for the demo. Next I configure security settings, again, we already set up a security group, so I'm going to choose an existing security group, which is the load-balancer-traffic. Next, Configure Routing. Basically in this step, what I'm doing is I'm telling a load balancer where to route the traffic. In this case, I need to set up a target group, which I don't already have, so I need to set up a new target group.
Target groups are groups, basically, of instances to which the load balancer will send traffic. I'll give it a name. Primary-web-server-target. We're going to go with HTTP on port 80. The rest of these defaults look just fine. There's nothing else that I really need to change here. Next I register the target instances. I only have one instance launched so far, so there's only one that I can register.
So I'm going to go ahead and put this instance behind the load balancer. I'm going to add to registered on port 80. Next I can review. It gives me a chance to review my settings that I've chosen, everything looks good. I stuck with the defaults in most cases, which works just fine for our use case. And, click Create. Again, it gives us a little bit of an overview real quick there, and then it says success. The load balancer was launched. This takes us right into back to the load balancers view, and I can see some information about the load balancer, similar to the instance.
It's got some tabs down here providing the description with all the information about the load balancer. The listeners that have been set up, in this case we stuck with just the HTTP on port 80. Some monitoring, CloudWatch monitoring that provides a little bit of metrics and insight into the load balancer resource and how it's doing. And the tags that we set up, give it a name and an environment and a cost center. Okay, we set out on a mission to create a new load balancer, and mission accomplished. In the next video, I'll show you how to access the web server through the load balancer.
- Benefits of cloud services
- Making architectures scalable
- Examining cloud constraints
- Virtual servers, EC2, and Elastic IP
- Using the Amazon machine image
- Elastic load balancing
- Using CloudWatch for monitoring
- Security Models
- Elastic block storage
- S3, CloudFront, and Elastic Beanstalk
- Handling queues, workflows, and notifications
- Caching options and services
- Identity and access management
- Creating a custom server image
- Application deployment strategies
- Serverless architectures