title: AWS Lambda connection to external REDIS instance not working
body: <p>I'm writing a function to connect to a REDIS instance on REDISLABS. I have attached an API gateway to invoke this code. Strangely, while testing it is from API gateway test console,  it is not working. Unfortunately, I cant see any error on test console.</p>
  
  <p>I have moved the code to local machine as a normal NodeJS code and it works without any problem. My code looks like this:</p>
  
  <pre><code>exports.handler = async (event) =&gt; {
      var client = require('redis').createClient({
          host: 'redis-XXXXXXXX.c10.us-east-1-2.ec2.cloud.redislabs.com',
          password: 'XXXXXXXXXXXXX',
          port: '14021'
          });
  
      client.on('connect', () =&gt; {
          return {
              status: 200,
              message: 'connected'
          }
      });
  
      client.on('error', (error)=&gt; {
  
          return {
              status: 404,
              message: 'Something went wrong:'+ error
          };
  
      })
  };
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/95VLw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/95VLw.png" alt="Response from TEST Console"></a></p>
  
  <p>I have a VPC configured and a security group with all ports enabled(for testing) for outbound connection.</p>
  
  <p>Can someone suggest where I'm going wrong?</p>