Most Wanted
Most Wanted

Reputation: 7069

AWS ALB routes to other ALBs

Is it possible to implement such an architecture with ALBs? alb

I want publicly available domain name which ALB provides and then have a separate clusters (with own services) "mounted" under different routes (e.g. /cluster1, /cluster2, cluster3)

Are there any other solutions to implement such kind of setup?

Upvotes: 1

Views: 3504

Answers (2)

jimmanuel
jimmanuel

Reputation: 31

Treating it as a trivia question and not best design question, it is technically possible to do but it's a bit annoying.

  1. Make your top level ALB with 3 IP based Target Groups and path based listener rules to route to the correct groups.
  2. Make each sub-ALB and configure it to route to your services correctly.
  3. Connect the parent Target Groups to the sub IPs. Each sub-ALB will have a node in each subnet that you assign it to. Each ALB node will have dynamic IP. You can take the IPs for each Node from an ALB and add it to the correct Target Group in the parent ALB. You want to set it up so that each Target Group in the parent has the IPs of all ALB Nodes that you want it to route to.
  4. The ALB Node IPs are dynamic so you need to handle them being changed on you with no warning. Create a Cloudwatch event that triggers whenever the IP of a sub-ALB Node changes and use it to trigger a Lambda. Make the Lambda update the correct Target Group in the parent ALB with the new IPs.

There's a little bit of a Rube-Goldberg going on and it is annoying to get setup but it will work in practice.

Upvotes: 1

Mark B
Mark B

Reputation: 201058

No it's not possible, but there's also no reason to do this. You just need to setup routing rules in a single Application Load Balancer to route to different Target Groups.

Upvotes: 4

Related Questions