title: aws rds proxy throws timeout error from nodejs12.x
body: <p>I'm getting a connection timeout when I try to connect to mysql rds proxy. I'm followed this <a href="https://aws.amazon.com/es/blogs/compute/using-amazon-rds-proxy-with-aws-lambda/" rel="nofollow noreferrer">tutorial</a></p>
  
  <p>This is my code</p>
  
  <pre><code>import mysql2 from 'mysql2';
  import AWS from 'aws-sdk';
  const getConnection = async () =&gt; {
      const signer = new AWS.RDS.Signer({
          username: 'my-user-name',
          hostname: 'proxy-name.proxy-someid.us-east-1.rds.amazonaws.com',
          port: 3306
      });
  
      console.info('Connecting to MySQL proxy via IAM authentication');
  
      const rdsSignerAuth = () =&gt; () =&gt; {
          console.info('CALL rdsSignerAuth');
          return signer.getAuthToken({
              username: 'my-user-name',
              region: 'us-east-1',
              hostname: 'proxy-name.proxy-someid.us-east-1.rds.amazonaws.com',
              port: 3306
          });
      };
  
      let connection;
      try {
          connection = await mysql2.createConnection({
              host: 'proxy-name.proxy-someid.us-east-1.rds.amazonaws.com',
              user: 'my-user-name',
              database: 'database-name',
              connectTimeout: 60000,
              ssl: { rejectUnauthorized: false },
              authPlugins: { mysql_clear_password: rdsSignerAuth },
          });
          console.info('Connected');
      }
      catch (e) {
          console.error(`MySQL connection error: ${e}`);
          throw e;
      }
      return connection;
  };
  const mysql2Impl = async () =&gt; {
      const connection = await getConnection();
      //console.info({ type: 'connection', connection });
      const result = await connection.promise().query('select * from destiny;');
      console.info({ type: 'result', result });
  };
  export async function testRdsProxy(event, context){
      console.info(JSON.stringify({ event, context }));
      await mysql2Impl();
      return 200;
  }
  </code></pre>
  
  <p>And this is the response</p>
  
  <pre><code>Error {
      code: 'ETIMEDOUT',
      errno: undefined,
      message: 'connect ETIMEDOUT',
      sqlState: undefined,
    }
  </code></pre>
  
  <p>I already checked that my lambda function has a policy "rds-db:connect" to "*" resource. Besides, I checked that my proxy is in the same VPC and subnet that my rds db. The secret that holds the credentials to RDS is ok. What I am doing wrong?</p>