title: s3.getObject().promise() never returns anything
body: <p>If use this code within a Lambda which complies with everything I read on stackoverflow and on the AWS SDK documentation.</p>
  
  <p>However, it neither returns anything nor throws an error. The code is simply stuck on s3.getObject(params).promise() so the lambda function runs on a timeout, even after more then 30 seconds. The file i try to fetch is actually 25kb. </p>
  
  <p>Any idea why this happens?</p>
  
  <pre><code>var AWS = require('aws-sdk');
  var s3 = new AWS.S3({httpOptions: {timeout: 3000}});    
  
  async function getObject(bucket, objectKey) {
          try {
              const params = {
                  Bucket: bucket,
                  Key: objectKey
              }
              console.log("Trying to fetch " + objectKey + " from bucket " + bucket)
              const data = await s3.getObject(params).promise()
              console.log("Done loading image from S3")
              return data.Body.toString('utf-8')
          } catch (e) {
              console.log("error loading from S3")
              throw new Error(`Could not retrieve file from S3: ${e.message}`)
          }
      }
  </code></pre>
  
  <p>When testing the function, i receive the following timeout.</p>
  
  <blockquote>
    <p>START RequestId: 97782eac-019b-4d46-9e1e-3dc36ad87124 Version: $LATEST
    2019-03-19T07:51:30.225Z    97782eac-019b-4d46-9e1e-3dc36ad87124    Trying to fetch public-images/low/ZARGES_41137_PROD_TECH_ST_LI.jpg from bucket zarges-pimdata-test
    2019-03-19T07:51:54.979Z    97782eac-019b-4d46-9e1e-3dc36ad87124    error loading from S3
    2019-03-19T07:51:54.981Z    97782eac-019b-4d46-9e1e-3dc36ad87124    {"errorMessage":"Could not retrieve file from S3: Connection timed out after 3000ms","errorType":"Error","stackTrace":["getObject (/var/task/index.js:430:15)","","process._tickDomainCallback (internal/process/next_tick.js:228:7)"]}
    END RequestId: 97782eac-019b-4d46-9e1e-3dc36ad87124
    REPORT RequestId: 97782eac-019b-4d46-9e1e-3dc36ad87124  Duration: 24876.90 ms
    Billed Duration: 24900 ms   Memory Size: 512 MB Max Memory Used: 120 MB</p>
  </blockquote>
  
  <p>The image I am fetching is actually public available:
  <a href="https://s3.eu-central-1.amazonaws.com/zarges-pimdata-test/public-images/low/ZARGES_41137_PROD_TECH_ST_LI.jpg" rel="noreferrer">https://s3.eu-central-1.amazonaws.com/zarges-pimdata-test/public-images/low/ZARGES_41137_PROD_TECH_ST_LI.jpg</a></p>