0

In AWS EC2, I have one Application Load Balancer (ALB) alb1-556083996.us-east-1.elb.amazonaws.com, and two target groups tg-blue and tg-green.

In AWS route53, I have two records api.myapp.example.com and api-blue.myapp.example.com.

The route53 record api.myapp.example.com is aliased to api-blue.myapp.example.com which is alieased to an AWS ALB alb1-123456789.us-east-1.elb.amazonaws.com.

Both of these two route53 records are latency based with Evaluate target health enabled.

The route53 record api.myapp.example.com also can be aliased to api-green.myapp.example.com at some point instead of aliasing to api-blue.myapp.example.com.

I'd like to create following ALB listener rules:

  1. When the host api.* will be pointing to api-blue.*, the traffics will be forwarded to the target group tg-blue.
  2. When the host 'api.* will be pointing to api-green.*, the traffics will be forwarded to the target group tg-green.
  3. The default rule will return a FIXED_RESPONSE.

In addition, as Evaluate target health and latency based routing have been enabled on both level of aliases, I'd expect the traffics will never be dropped as long as at least one target group has targets registered to it.

I have LB access logs enabled. When I hit api.myapp.example.com or api-blue.myapp.example.com, the host api-blue.* does not appear in the access logs. So, I'm afraid that host-headers based rule won't work here. I will need a lot of experiments to be able to figure out if the above is working or not.

So, I'm trying to find out whether it is possible or not from someone knowledgable in this area. If it is not possible, how can I achieve this?

Rafiq
  • 1,380
  • 4
  • 16
  • 31

0 Answers0