Try AWS Application Load Balancer

My name is Sashihara and I am an infrastructure engineer.
Let's try out AWS's Application Load Balancer, which was released last month.
AWS | Elastic Load Balancing | Application Load Balancer
The difference with ELB is the addition of L7 distribution functionality.
It seems to support path-based routing.
Also, with the addition of path-based routing, a group called a target group has been added.
Unfortunately, it does not seem to support domain-level distribution.
In addition, HTTP/2 is supported and various other features have been added.
Try Application Load Balancer
For now, we will prepare two EC2 instances and place an ALB on top of them.
Normal access will refer to instance1, and if there is an access via the path "/instance2", instance2 will be accessed.
Creating a Target Group
First, create the target group as explained above
As the name suggests, a target group is a group for specifying targets.
There is a target group in the EC2 dashboard, so proceed to "Create a target group".
First, create "instance1-tg" for default access.
Since we will only be using HTTP this time, we will leave it as is.
Simply click "Create" and the target group will be created
If you leave it as it is, the instances in the target group will not be specified, so you will need to register them

Select instance1 and add it to the registered list

create a target group in the same way as before to connect to another instance when access is made at "/instance2"
Register instance2 to the target group
This completes the creation of the target group
Next, create an ALB
Creating an ALB
When you click Create Load Balancer, you can choose between ALB or ELB
Since we will be using ALB this time, select "Application Load Balancer"

Set the name to "application-LB" and select "HTTP" as the protocol.
Select the VPC and subnet to use.

If you proceed further, you will get a warning that "It would be better to use HTTPS," but
since HTTPS is not supported this time, we will ignore it.
Next, we will configure the security group.
In this example, we will select the security group for web access that we prepared in advance.
Next, register the target group you created earlier.
Set instance1-tg for default access and proceed to the next step.

Verify the information for instance1 and create an application load balancer
Balancer created!
However, if you leave it as it is, instance2-tg will not be set up, so you will need to set it up
After selecting the balancer, click Add Rule

Then, enter "/instance2" as the path pattern, select instance2-tg as the target group, and click "Save."
The setup is now complete
I'll try accessing it for now
If no path is specified, instance1 will be accessed

If you then specify the path "/instance2", instance2 will be accessed
It's distributed on a path-based basis
Previously, only L4 distribution was possible, but now LB with L7 distribution has been released.
I think various functions will be added in the future, so it seems like it will be useful in a variety of situations.
0






