I do all my web development projects using Cloud9 (which is actually part of AWS now). Anyways I have had no problem connecting using the built in PHP functions and variables but the Node platform has been giving me some trouble. The Cloud9 community guide for connecting to MySQL was much more clear for PHP than Node, and other questions and answers I have found online have had a large array of suggests but none have worked. Here is what I would have considered my best bet:
var connection = mysql.createConnection({
host: process.env.IP,
user: process.env.C9_USER,
password: "",
port: 3306,
database: "database_name"
});