Let’s talk about AWS basic networking! We will be introducing instances and test the web applications. Then, we will provision AWS Elastic Load balancer (ELB). ELB has 3 Types: Application, Network and Gateway Load Balancer but we will be focusing more on Application Load Balancer.
Upon creation of these Application load balancer we will associate the Virtual Private Cloud(VPC), Security Groups (SG), Target groups and many more!
AWS Application Load Balancer Configuration
Here is a guide or steps to create ELB, Application Load Balancer:
Basic Configuration, Network Mapping and Security Group:
- Go to EC2 managment console page and on the left pane, click Load Balancer under Load Balancing
- By default, there are no Load Balancers created. Click Create Load Balancer located on the upper right of the main pane.
- This takes you to the Load Balancer creation page. Select Application Load Balancer since our application runs in HTTP/HTTPS
- Assign Load Balancer name, select the VPC used the EC2 instances, Select Availability Zone (s) and their public subnets.
- Under Security Group (SG), create a new one if necessary. Otherwise, select the correct SG for your ELB.
Listeners and Routing
- Select HTTP Protocol and Port 80 (This can be HTTPS/443)
- Since we still don’t Target Port, we will create one. Click Create Target Group. This will open a new tab.
- Choose Instance as target type and assign Target group name. Make sure protocol/port are HTTP/80. Make sure correct VPC is applied and click Next. This will take you to Register targets page.
- Select EC2 instance name where you Load Balancer will forward the traffic to. Make sure port is set to 80 and click Include as pending below.
- Verify new target is added with the Health Status Pending and click Create target group.
- Back to Listening and routing, select the newly created Target group (hit refresh icon if its still not available) and click Create load balancer.
- Click View load balancer. You will see the status is in Provisioning state as it may take a minute or two for the load balancer to be created.
Test Elastic Load Balancer
- From the same page, click the Application Load Balancer name
- You will see the DNS name, this is the actual URL we will be using to test the load balancer.
- Copy the URL and paste it to the web browser address bar
- You should get the same page of our EC2. Make sure that the page is using Load Balancer DNS URL.
Click below to access the video version and consider subscribing.