For those of you who need cross-region connectivity, there are a couple of ways to do it:
1) Create an OpenSwan (or OpenVPN, or whatever) tunnel between two endpoints in each region and set them as gateways.
2) Spin up a software VPN (like Vyatta or Sophos UTM) in VPC 1, and use it to connect to a VGW in VPC 2.
Personally I think the second method is better, because it allows you to actually reference IPs on both sides with Security Groups. On the other hand, there are no free software VPNs from a trusted vendor (Vyatta has a community version but they don’t release a build of it on the AWS Marketplace).
To illustrate what I’m talking about WRT the IPs, consider the following setup – let’s assume I want to do DB replication from a master in us-east-1 to a slave in us-west-2:
VPC 1 (us-east-1): 10.0.0.0/16
IPSec gateway 1: 10.0.0.3
DB server 1: 10.0.0.4
VPC 2 (us-west-2): 10.1.0.0/16
IPSec gateway 2: 10.1.0.3
DB server 2: 10.1.0.4
Now, if I set up connectivity between the two IPSec gateways, I can set up the replication from DB server 1 to DB server 2; DB server 1 will connect to 10.1.0.4 and DB server 2 will see that connection as coming from 10.0.0.4. All good.
However, from the perspective of the AWS Security Groups, there are two sets of communications going on that have nothing to do with one another: according to VPC 1, DB server 1 is talking to IPSec gateway 1, which is talking to IPSec gateway 2. According to VPC 2, IPSec gateway 2 is talking to IPSec gateway 1, and IPSec gateway 2 is talking to DB server 2. They’re not able to see the big picture, and unfortunately that means that we can’t create Security Groups to properly set rules – rather than having a rule that says “DB server 2 can be reached by DB server 1″, we need to specify that “DB server 2 can be reached by IPSec gateway 2″. Unfortunately, ANY traffic that’s coming over the gateway will look like it’s coming from IPSec gateway 2, so we’re effectively opening up the DB server to everything in VPC 1 that’s able to use the IPSec gateway.
Nonetheless, setting up a IPSec tunnel between VPCs can be a viable choice for customers looking to save some money or who are uncomfortable leveraging 3rd-party tools in their environment.
Interested in a CFN template to automagically do this for you? Shoot me an email and let’s talk!