title: How can I connect to an RDS DB from a Lambda function?
body: <p>I'm having trouble trying connecting to a public RDS instance (MySQL) that I have set up.
  I've tested my Lambda code locally (laptop) and it can connect to the MySQL instance and add rows to a table.  However, when I run the code via Lambda, I'm getting this connection error:</p>
  
  <pre><code>Error: connect ETIMEDOUT at Connection._handleConnectTimeout 
  (/var/task/node_modules/mysql/lib/Connection.js:412:13)
  </code></pre>
  
  <p>I have configured the Lambda function as such:</p>
  
  <pre><code>- No VPC
  - Role:  "Basic with DynamoDB" (a tutorial mentioned using this)
  </code></pre>
  
  <p>The RDS database has a public URL and as in a security group that allows inbound connections to port 3306 from any host.  I can connect to it from my laptop successfully and run queries.</p>
  
  <p>Any recommendations on how my Lambda can connect to the MySQL DB?
  I've been stuck on this for hours.</p>