Node.js Elastic Beanstalk TIMEDOUT Error


I got an error when deploying my Node.js app into AWS Elastic Beanstalk (EB). The error said

Error: connect ETIMEDOUT
    at errnoException (net.js:901:11)
    at Object.afterConnect [as oncomplete] (net.js:892:19)
    at Protocol._enqueue (/var/app/current/node_modules/mysql/lib/protocol/Protocol.js:110:26)
    at Protocol.handshake (/var/app/current/node_modules/mysql/lib/protocol/Protocol.js:42:41)

My Node.js app using node-mysql module to access database. You can see “mysql” in the error statement. Seeing from errors, this must be related with database. I use Amazon Relational Database Service (RDS) and my node.js app is configured to connect with it.

Continue reading