title: Connect to RDS in a different region from EC2 instance
body: <p>So I have a primary RDS in <code>us-east-1</code> &amp; a replica in <code>us-west-1</code>. Both are inside VPCs in their respective regions. I want to have one of my EC2 instances in <code>us-east-1</code> connect to the replica instance. </p>
  
  <p>A simple solution is to enable public access for the RDS replica and add the IP of the EC2 to its security group and it works.</p>
  
  <p>But instead of allowing a static IP, I would like to allow access to the entire CIDR range of my <code>us-east-1</code> VPC and also I don't want my instances to be public accessible.</p>
  
  <p>To do this, I've setup a VPC peering connection between the two regions and I have added entries in the routing tables of both the VPCs to forward traffic to each other's CIDR ranges to the peering connections.</p>
  
  <p>The CIRD range of the EC2 instance is <code>172.31.0.0/16</code> and I have added this to the security group of the RDS replica in the <code>us-west-1</code> region. But for some reason the RDS is not reachable from my EC2.</p>
  
  <p>Have I missed anything else? Thanks!</p>
  
  <p>To summarize my setup:</p>
  
  <p><strong>US EAST</strong>:</p>
  
  <ul>
  <li>VPC CIDR: <code>172.31.0.0/16</code></li>
  <li>Route Table entry: Destination <code>10.0.0.0/16</code> routes to the peering connection of <code>us-west-1</code> VPC.</li>
  <li>EC2 IP: <code>172.31.5.234</code></li>
  </ul>
  
  <p><strong>US WEST</strong>:</p>
  
  <ul>
  <li><p>VPC CIDR: <code>10.0.0.0/16</code></p></li>
  <li><p>Route Table entry: Destination <code>172.31.0.0/16</code> routes to the peering connection of <code>us-east-1</code> VPC.</p></li>
  <li><p>RDS:</p>
  
  <ul>
  <li>Public Accessible: Yes</li>
  <li>Security Group: Allow connections from <code>172.31.0.0/16</code></li>
  </ul></li>
  </ul>