dimanche 1 février 2015

Conecting AWS Lambda to Redshift : Error: getaddrinfo ENOTFOUND

I created an AWS Lambda function that:



  • logs onto Redshift via JDBC URL

  • runs a query


Locally, using Node, I can successfully run the query:



var conString = "http://postgresqlUSER_NAME:PASSWORD@JDBC_URL”;
var r = pg.connect(conString, function(err, client) {

if(err) {

console.log('could not connect to redshift', err);

}

// omitted due to above error


However, when I execute the function on AWS Lambda (where it's wrapped in a async#waterfall block), AWS Cloudwatch logs tell me:



could not connect to redshift { [Error: getaddrinfo ENOTFOUND] code: 'ENOTFOUND', errno: 'ENOTFOUND', syscall: 'getaddrinfo' }



Any ideas on why the address wouldn't be found when running the function in Lambda?





Aucun commentaire:

Enregistrer un commentaire