2

I have 2 VPCs (X and Y). We have a vpc peering connection between the two. In VPC X, we have a CNAME that needs to resolve to an ELB in VPC Y. Is there any way to make an ELB in VPC X forward traffic to an ELB in VPC Y?

I know this configuration is weird and it's not something I can really change, so I'm going to try whatever makes sense to move forward.

jamesatha
  • 123
  • 5
  • I don't know, typically an ELB routes to EC2. My quick experience suggest probably not possible, but maybe someone has found a way. First step is likely to be getting DNS working between the VPCs: this page, modifying VPC peering options : http://docs.aws.amazon.com/AmazonVPC/latest/PeeringGuide/working-with-vpc-peering.html#modify-peering-connections – Tim Mar 16 '17 at 00:11

1 Answers1

3

You can't add an ELB as a backend behind another ELB.

You might be able to add instances in one VPC directly to an ELB in another if the VPCs are peered, but this seems unlikely.

The obvious workaround is the same one you use to work around most things (or maybe that's just me) -- a proxy server (or more than one, for redundancy) -- running in EC2 in the local VPC configured as a back-end instance behind the local ELB, routing requests across the peering connection to the remote balancer. HAProxy 1.6 or later can handle the periodically-changing IP addresses of ELB (ELB IP addresses change with automatic node scaling and/or failure) and Nginx can handle too, with correct configurarion.

Michael - sqlbot
  • 21,988
  • 1
  • 57
  • 81