title: Access cross region s3 endpoint through private subnet
body: <p>I have an EMR which is spinning up in <code>eu-west-1</code> <strong>private subnet</strong>. I have defined a gateway endpoint for S3 in the route table. I have to access this <strong>public</strong> bucket/location exposed by AWS: <code>s3://us-east-1.elasticmapreduce/libs/script-runner/script-runner.jar</code> which is giving below error. I think this is because of cross-region access through gateway endpoint which is not allowed. <strong>I am able to access other buckets which are in the same region</strong>. Is there a workaround to access this, maybe through NAT? The route table already has a NAT but the request is somehow not going through that.</p>
  
  <pre><code>2019-04-10T05:17:06.849Z INFO Ensure step 1 jar file s3://us-east-1.elasticmapreduce/libs/script-runner/script-runner.jar
  INFO Failed to download: s3://us-east-1.elasticmapreduce/libs/script-runner/script-runner.jar
  java.lang.RuntimeException: Error whilst fetching 's3://us-east-1.elasticmapreduce/libs/script-runner/script-runner.jar'
      at aws157.instancecontroller.util.S3Wrapper.fetchS3HadoopFileToLocal(S3Wrapper.java:412)
      at aws157.instancecontroller.util.S3Wrapper.fetchHadoopFileToLocal(S3Wrapper.java:351)
      at aws157.instancecontroller.master.steprunner.HadoopJarStepRunner$Runner.&lt;init&gt;(HadoopJarStepRunner.java:243)
      at aws157.instancecontroller.master.steprunner.HadoopJarStepRunner.createRunner(HadoopJarStepRunner.java:152)
      at aws157.instancecontroller.master.steprunner.HadoopJarStepRunner.createRunner(HadoopJarStepRunner.java:146)
      at aws157.instancecontroller.master.steprunner.StepExecutor.runStep(StepExecutor.java:136)
      at aws157.instancecontroller.master.steprunner.StepExecutor.run(StepExecutor.java:70)
      at aws157.instancecontroller.master.steprunner.StepExecutionManager.enqueueStep(StepExecutionManager.java:248)
      at aws157.instancecontroller.master.steprunner.StepExecutionManager.doRun(StepExecutionManager.java:195)
      at aws157.instancecontroller.master.steprunner.StepExecutionManager.access$000(StepExecutionManager.java:33)
      at aws157.instancecontroller.master.steprunner.StepExecutionManager$1.run(StepExecutionManager.java:94)
  Caused by: com.amazonaws.AmazonClientException: Unable to execute HTTP request: connect timed out
      at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:618)
      at com.amazonaws.http.AmazonHttpClient.doExecute(AmazonHttpClient.java:376)
      at com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:338)
      at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:287)
      at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:3826)
      at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1143)
      at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1021)
      at aws157.instancecontroller.util.S3Wrapper.copyS3ObjectToFile(S3Wrapper.java:303)
      at aws157.instancecontroller.util.S3Wrapper.getFile(S3Wrapper.java:287)
      at aws157.instancecontroller.util.S3Wrapper.fetchS3HadoopFileToLocal(S3Wrapper.java:399)
      ... 10 more
  </code></pre>