Search code examples
amazon-web-servicesamazon-elbamazon-vpc

Route traffic, bases on paths, between 2 VPCs using a ALB


is it possible to route traffic from an ALB in VPC1 to an ALB on VPC2?

Alternatively, is possible to configure an ALB in VPC1 to have 2 listeners, and each one points to a different Target Group, one in VPC1 and the other in VPC2?

what I'm trying to do is route some traffic, bases on paths, between 2 VPCs using a ALB.


Solution

  • Based on the comments.

    If the VPC1 and VPC2 are peered, and VPC1 has ALB while VPC2 has NLB, joining the two load balancers between the two can be performed as followed:

    1. Setup NLB in VPC2 as an internal balancer. This will provide a static private IP for the NLB.

    2. Setup a target group for ALB in VPC1 that uses targets based on IP address. The targets can be only private IP address (not public). Therefore, you can add IP addresses of the NLB from VPC 2 as targets for ALB in VPC1.