title: HTTP Requests in an AWS Lambda
body: <p>I'm new to Lambdas so perhaps there is something I've not caught on to just yet, but I've written a simple Lambda function to do an HTTP request to an external site.  For some reason, whether I use Node's <code>http</code> or <code>https</code> modules, I get an <code>ECONNREFUSED</code>.  </p>
  
  <p>Here's my Lambda:</p>
  
  <pre><code>var http = require('http');
  
  exports.handler = function (event, context) {
      http.get('www.google.com', function (result) {
          console.log('Success, with: ' + result.statusCode);
          context.done(null);
      }).on('error', function (err) {
          console.log('Error, with: ' + err.message);
          context.done("Failed");
      });
  };
  </code></pre>
  
  <p>Here's the log output:</p>
  
  <pre><code>START RequestId: request hash
  2015-08-04T14:57:56.744Z    request hash                Error, with: connect ECONNREFUSED
  2015-08-04T14:57:56.744Z    request hash                {"errorMessage":"Failed"}
  END RequestId: request hash
  </code></pre>
  
  <p>Is there a role permission I need to have to do HTTP requests?  Does Lambda even permit plain old HTTP requests?  Are there special headers I need to set?</p>
  
  <p>Any guidance is appreciated.</p>