title: Connecting to S3 bucket thru S3 VPC Endpoint inside EC2 instance timing out
body: <p>I am receiving "Could not connect to the endpoint URL: "<a href="https://s3.amazonaws.com/" rel="nofollow">https://s3.amazonaws.com/</a>" from inside EC2 instance running in private subnet</p>
  
  <p>Here is a configuration:</p>
  
  <ol>
  <li><p>Created one VPC with 2 private subnets (yes.. no public) that is
  connected to our datacenter using VPN connection. This VPC does not
  have any IG or NAT. </p></li>
  <li><p>Created EC2 instance(Amazon Linux AMI) inside
  one of the private subnet.</p></li>
  <li>Connected to EC2 using Putty-
  successfully. </li>
  <li><p>Now created an endpoint - S3 that is connected to
  the VPC (in step1) and policy is as follows (as presented by aws
  management console):</p>
  
  <pre><code>{
      "Statement": [
          {
              "Action": "*",
              "Effect": "Allow",
              "Resource": "*",
              "Principal": "*"
          }
      ]
  } 
  </code></pre></li>
  <li>Routing is automatically added to the VPC routing where destination is pl-xxxxxxxx(com.amazonaws.us-east-1.s3) and target is
  the endpoint created in step4, status Active, Propogated - No</li>
  <li>Added 2 outbound rules in Security Group for the VPC:  (HTTP:80, HTTP:443) to destination prefix s3 endpoint starting with
  pl-xxxxxxxx (same as step 5).</li>
  <li>Created a bucket in S3 using amazon management console</li>
  <li><p>Edited bucket policy as follows</p>
  
  <pre><code>    {
      "Version": "2012-10-17",
      "Id": "Policy1459706251964",
      "Statement": [
          {
              "Sid": "Stmt1459706246215",
              "Effect": "Allow",
              "Principal": "*",
              "Action": "s3:*",
              "Resource": [
                  "arn:aws:s3:::mybucket/*",
                  "arn:aws:s3:::mybucket"
              ]
          }
      ]
  }
  </code></pre></li>
  <li><p>Now entered following command in putty session </p>
  
  <pre><code> aws s3 ls --debug --endpoint-url https://s3.amazonaws.com/mybucket
  </code></pre></li>
  <li><p>I got "EndpointConnectionError: Could not connect to the endpoint URL in #9</p></li>
  </ol>
  
  <p>I know I am missing something..Any help will be greatly
      appreciated..</p>