AWS ALB's two ways to connect to target groups

·

1 min read

I am using Elastic Load Balancing which distributes traffic to multiple target groups. Today, I found a new way to set a rule. The first time I used ALB in AWS, I set the path to ALB, and this ALB can be accessed directly by DNS domain address. To do so, as a rule on the listener, we can set path "/path", and when ALB receives a request, it redirects the request to the target group.

But practically, it is unlikely to directly access DNS with the ALB DNS domain address. Instead, we use the Domain Name Service Route53. The Domain name registered in Route53 can be set in a rule of the lister as a hostname. Once the hostname is registered, the request to the hostname is redirected to the target group. This can be achieved by setting the rule.

On top of that, in Route53, you can set what service a certain domain is connected to. If it is ALB, you can access it from the domain registered on Route 53. If you want to use CDN, you can set the endpoint of the Domain to CDN rather than LB.