title: RDS mysql public database cannot connect from AWS Lambda
body: <p>my RDS mysql public database instance can be connected from mysql clients. But when i trying the same in AWS Lambda it won't work. my code is given below. </p>
  
  <pre><code>console.log('Loading function');
  var doc = require('dynamodb-doc');
  var dynamo = new doc.DynamoDB();
  var mysql = require('mysql');
  exports.handler = function(event, context) {
  //console.log('Received event:', JSON.stringify(event, null, 2));  
  var operation = event.operation;
  delete event.operation;
  switch (operation) {
  case 'create':
  var conn = mysql.createConnection({
  host      :  'lamdatest.********.rds.amazonaws.com' ,  // RDS endpoint 
  user      :  'user' ,  // MySQL username 
  password  :  'password' ,  // MySQL password 
  database  :  'rdslamda' 
  });
  conn.connect();
  console.log("connecting...");
  conn.query ( 'INSERT INTO login (name,password) VALUES("use6","password6")' ,     function(err, info){
          console.log("insert: "+info.msg+" /err: "+err);
      });
  console.log("insert values in to database");
  break;
  case 'read':
  dynamo.getItem(event, context.done());
  break;
  
  default:
  context.fail(new Error('Unrecognized operation "' + operation + '"'));
  
  }
  context.succeed();
  };  
  </code></pre>
  
  <p>When i checked out the mysqli-error.log file in the RDS it's shows an error given below.  </p>
  
  <pre><code>2015-08-09 19:36:24 2630 [Warning] IP address '117.253.192.122' could not be resolved:  
  Temporary failure in name resolution  
  
  ----------------------- END OF LOG ----------------------
  </code></pre>