5
votes

I'm working on a project where one of the tasks is to provide AWS ELB services for instances in a remote VPC. The AWS ELB is located in VPC A and the instances are located in VPC B. My initial response- No, because the ELB is a load balancer, not a router. Documentation and working with the AWS ELB indicate that load balancing to subnets/instances in a remote VPC is not supported or can be configured.

I'm checking to see if anyone tried this scenario to any form of success.

Many thanks for any response or feedback.

2
It might work if you can enable VPC peering. docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-peering.html However I don't understand what scenario would cause you to want your ELB in a different VPC from your instances.Mark B
Hey John! I was working on a project using multiple VPCs. A colleague attempted to add EC2 instances in VPC A under an ELB located in VPC B. I wanted to do some due diligence to help address this objective.Byron J. Watson

2 Answers

6
votes

AWS now offers Application Load Balancing via IP Addresses. This means you could configure ALBs to directly route traffic to IPs in any peered VPC. This safes you from extra hops and bigger complexity an additional custom proxy layer would bring with it.

5
votes

An ELB can only attach instances that are reachable by it.

When you place an ELB in a VPC it's constrained there. VPC's are independent and can have overlapping subnet ranges.

Ie if your ELB is in VPC A with 10.0.0.0/8 and you had another VPC B with 10.0.0.0/8 there's no way it could differentiate that route. It would be dangerous to cross that boundary and send data say to 10.0.0.8 if there was an instance in both VPC's with that IP. It has no route that can figure that out. If you want to send data from VPC to VPC you'd need a VPC peering connection and routes that handle that. Then you'd send to a proxy in VPC A that sends it to either an ELB or the instance in VPC B