title: AWS RDSDataService times out whereas external mysql package works
body: <p>I have a AWS Lambda (Node.js) talking to an Aurora database. Both belong to the same VPC, with internet access enabled via subnet. The RDS cluster also has a inbound rule that allows traffic from the VPC, used for the Lambda (which should be the same VPC). To my surprise, I found that the <code>RDSDataService</code> from <code>AWS-SDK</code> fails to connect to the database, whereas when I use <a href="https://www.npmjs.com/package/mysql" rel="nofollow noreferrer"><code>mysql</code> pacakge</a>, it works. Following are the 2 code snippets. </p>
  
  <p>I would like it very much to use AWS-SDK, as that will reduce the deployment bundle size, as I don't have to include that in the bundle that at all. Is there anyway to achieve that?</p>
  
  <p><strong>Failed attempt to use <code>RDSDataService</code></strong></p>
  
  <pre><code>const AWS = require("aws-sdk");
  const rdsData = new AWS.RDSDataService({
      params: {
          dbClusterOrInstanceArn: 'rds.cluster.arn',
          awsSecretStoreArn: 'rds.cluster.secret.arn',
          database: 'mydb'
      },
      endpoint: 'mydb.endpoint'
  });
  
  return new Promise((resolve, reject) =&gt; {
      try {
          rdsData.executeSql({
              dbClusterOrInstanceArn: 'rds.cluster.arn',
              awsSecretStoreArn: 'rds.cluster.secret.arn',
              database: 'mydb',
              sqlStatements: "select 1 + 1 as result;"
          }, (err, data) =&gt; {
              if (err) {
                  reject(err);
              }
              const response = {
                  statusCode: 200,
                  body: JSON.stringify(data),
              };
              resolve(response);
          });
      } catch (er) {
          reject(er);
      }
  });
  </code></pre>
  
  <p><strong>Working implementation using <code>mysql</code></strong></p>
  
  <pre><code>const mysql = require('mysql');
  const connection = mysql.createConnection({
      host: 'mydb.endpoint',
      user: 'user',
      password: 'password',
      port: 3306,
      database: 'mydb',
      debug: false
  });
  
  connection.connect(function (err) {
      if (err) context.fail();
      else {
          connection.query('select 1 + 1 as result', function (error, results, fields) {
              if (error) throw error;
              resolve('The solution is: ' + JSON.stringify(results, undefined, 2));
          });
      }
  });
  connection.end();
  </code></pre>