How to connect CDBConnection with AWS RDS Auth Token

Hi,

My server is in AWS EC2, connected to RDS using Auth Token instead of a password string.

How do I connect CDBConnection to RDS using Auth Token?

Can you explain what RDS is and may be further details for us who haven’t used it.
And then may be one can provide a pointer or some details

RDS is the SQL database in Amazon AWS

1 Like

so anyone?

Just dig a little bit dig, it seems RDS is actually mysql or mysql-like. So you connect just like any MYSQL server. See the link below for more details

so something like

$serverName = "aws-test-db.hizibizi.us-west-2.rds.amazonaws.com";  //Your instance here
$username = "<USERNAME>";  
$password = "<PASSWORD>"; 
$dbName='<DATABASE>'; 
$dsn = "mysql:host={$serverName};port:3306;dbname={$dbName}";
$connection = new CDbConnection($dsn, $username, $password);
//... do some other stuffs

You can add in the config once everything works to use the db component
Let me know if that works