Application Load Balancer (AWS ALB) — new features
AWS ALB two new actions: redirect and fixed-response
Currently, In AWS we have three kinds of load balancers
- Application Load Balancer (ALB)
- Network Balancer
- Elastic Load Balancer (ELB)
AWS is heavily promoting Application Load Balancer. If you noticed in the image above they are showing ELB as a “Previous Generation” load balancer in gray.
I have no doubt about the simplicity of ELB, one can start using in a minute. It is a classic round-robin fashion load balancer. On the other hand, ALB does provide a wide range of functions from which one can be benefited. Also after a little bit of time, one could use ALB without any problem.
So I had decided to use ALB in one of my recent projects and guess what I ran into a problem and made me think why I have used ALB.
A problem was, In ALB if you want to transfer your HTTP load to HTTPS there was no easy way out. I have searched and read many blogs and I found one solution —There is the instance port in ELB configuration but for ALB is not. So if you want to redirect HTTP to HTTPS correctly, you should create another target group for HTTPS.
Above mentioned solution worked for me but still, I was not satisfied with a solution so I kept digging for the solution and finally found following,
Elastic Load Balancing Announces Support for Redirects and Fixed Responses for Application Load Balancer
Posted On: Jul 25, 2018 — https://aws.amazon.com/about-aws/whats-new/2018/07/elastic-load-balancing-announces-support-for-redirects-and-fixed-responses-for-application-load-balancer/
Now I by simple settings and ACM imported SSL certificate I was able to transfer HTTP load to HTTPS. (No need to two target groups)
By the way, I do suggest that you should check all three load balancers and choose load balancer which fits your application.
For those who don’t know What is the target group,
Each target group routes requests to one or more registered targets, such as EC2 instances, using the protocol and port number that you specify. You can register a target with multiple target groups. You can configure health checks on a per target group basis. Health checks are performed on all targets registered to a target group that is specified in a listener rule for your load balancer. — https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html#application-load-balancer-components