title: Node.js Lambda Async return Undefined
body: <p>Simple call to ec2 Describing Security groups and returning the security group ID. Using Async / await, but when logging the return value, I get undefined. I fully admit I'm coming from Python and I've tried my hardest to wrap my brain around async calls. I thought I had it nailed, but I'm obviously missing something.</p>
  
  <pre><code>'use strict';
  
  // Load Modules
  const AWS = require('aws-sdk')
  
  //Set the region
  AWS.config.update({region: 'us-west-2'});
  
  // Call AWS Resources
  const ec2 = new AWS.EC2();
  
  // Get Security Group ID From Event
  const getSgIdFromEvent = async (event) =&gt; {
    var ec2params = { Filters: [{Name: 'tag:t_whitelist',Values[event['site']]}]};
    await ec2.describeSecurityGroups(ec2params, function (err, response) {
      if (err) {return console.error(err.message)}
      else {
        var sgId = response.SecurityGroups[0].GroupId;
        return sgId;
      };
    });
   };
  // MAIN FUNCTION
  exports.handler = (event, context) =&gt; {
    getSgIdFromEvent(event)
     .then(sgId =&gt; {console.log(sgId)});
  }
  </code></pre>
  
  <p>"sgId" should return the security group ID. It does print out fine in the original function before the return.</p>