Search code examples
amazon-web-servicesamazon-ec2load-balancingamazon-elb

AWS: How to load balance multiple VPCs


I have three VPCs, main-vpc, vpc-a and vpc-b on AWS. I created VPC peering.

VPC peering:
main-vpc and vpc-a
main-vpc and vpc-b

vpc-a has a eks cluster. vpc-b has its eks cluster. Both eks clusters expose the LoadBalancer. I can hit the URLs of vpc-a(eks) and vpc-b(eks). I would like to create a load balancer at main-vpc so that traffic can be directed to vpc-a and vpc-b. How to do that?


Solution

  • What is the reason you need to do this?

    If the load balancer is private (already having peering there are no problems): https://aws.amazon.com/premiumsupport/knowledge-center/elb-access-load-balancer-vpc-peering/

    If the load balancer is public you just need to point to the endpoints (they are reachable by other vpc).