title: Access Internet from AWS VPC instance without public IP address
body: <p>We're setting up an Amazon VPC in which we will provision (for now) a single EC2 instance and one RDS instance. This is to 'extend our data center', and should only be using private subnet(s).</p>
  <p>So actually, we have this setup, and it is working well (insert smiley face icon). For all intents and purposes, we're mirroring the VPC scenario 4 outlined by Amazon here: <a href="http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Scenario4.html" rel="nofollow noreferrer">http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Scenario4.html</a></p>
  <p><em>tl;dr: A single VCP, with a VPN connecting to our corporate network. The VPN uses a Virtual Private Gateway (VPC end) and Customer Gateway (our end) to allow us access as necessary to the EC2, which contains a webserver connecting to the RDS instance as needed. Anyone on our network has access to the web server running on the EC2 via a URL. All this is working as expected.</em></p>
  <p>The problem comes when the EC2 instance needs to access a resource on the Internet - The idea is for us to NOT have any public subnets, but to route all traffic from the EC2 instance through our VPN and out the 'standard' path of our corporate Internet access. However we're having trouble setting this up.</p>
  <p>The fact that it can be done is hightlighted in Amazon's FAQ here:
  <a href="https://aws.amazon.com/vpc/faqs/" rel="nofollow noreferrer">https://aws.amazon.com/vpc/faqs/</a></p>
  <blockquote>
  <p><strong>Q. How do instances without public IP addresses access the Internet?</strong></p>
  <p>Instances without public IP addresses can access the Internet in one of two ways:</p>
  <ol>
  <li><p>Instances without public IP addresses can route their traffic through a NAT gateway or a NAT instance to access the Internet. These instances use the public IP address of the NAT gateway or NAT instance to traverse the Internet. The NAT gateway or NAT instance allows outbound communication but doesn’t allow machines on the Internet to initiate a connection to the privately addressed instances.</p>
  </li>
  <li><p>For VPCs with a hardware VPN connection or Direct Connect connection, instances can route their Internet traffic down the virtual private gateway to your existing datacenter. From there, it can access the Internet via your existing egress points and network security/monitoring devices.</p>
  </li>
  </ol>
  </blockquote>
  <p>We are trying to avoid option #1 as there is a cost involved (along with complexity and security issues). #2 is the perfect resolution for us, but understanding the process to set it up has been eluding us for a while.</p>
  <p>Can anyone walk us through what we need to do (or point us to the correct resources) to ensure the EC2 instance* can access the Internet by routing the traffic down the VPN, through our corporate datacenter, and our our existing Internet access point?</p>
  <p>* <sub>and anything within the private subnet for that matter</sub></p>