title: AWS Lambda doesn't work with `async`, Only with callbacks?
body: <p>I have a Lambda function in AWS using Node 8.1 which initiate MSSQL request ( to an external server , which is not in aws)</p>
  
  <p>When I'm using the non <code>async</code>  handler with non async code (but callbacks )— </p>
  
  <pre><code>exports.handler = (event, context, callback) =&gt; {...}
  </code></pre>
  
  <p>— Everything is OK.</p>
  
  <p>Proof: For this code, which uses callbacks- </p>
  
  <pre><code>exports.handler = (event, context, callback) =&gt; {
       sql.connect(config, err =&gt; {
          if (err) {
            callback(err);
          } else {
            const req = new sql.Request();
            req.query(
              'select * from img.dbo.images where imageid = 1641',
              (error, result) =&gt; {
                if (error) {
                  callback(error);
                } else {
                  sql.close();
                  callback(null, result.recordset);
                }
              }
            );
          }
        });
  };
  </code></pre>
  
  <p>I get this response : </p>
  
  <p><a href="https://i.stack.imgur.com/rz0gN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rz0gN.png" alt="enter image description here"></a></p>
  
  <p><strong>However</strong> , If I change the code <a href="https://www.npmjs.com/package/mssql#asyncawait" rel="nofollow noreferrer"><em>to the async version</em></a> : </p>
  
  <pre><code>exports.handler = async (event, context, callback) =&gt; {
    try {
      let pool = await sql.connect(config);
      let result1 = await pool
        .request()
        .query('select * from img.dbo.images where imageid = 1641');
  
      callback(null, result1.recordset);
    } catch (err) {
      callback(err);
    }
  };
  </code></pre>
  
  <p>— I get a Timeout error(sure it's related to a non-fulfill promise) : </p>
  
  <p><a href="https://i.stack.imgur.com/a7hTc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/a7hTc.png" alt="enter image description here"></a></p>
  
  <p><strong>Question</strong></p>
  
  <p>Why doesn't the <code>async</code>  version work ? how can I make it work?</p>