We are using IAM Authentication in order to connect to an RDS mysql cluster. We are encountering a problem: the credentials that the connection pool is using have to be modified every 15 minutes, because AWS only provide tokens with a TTL of 15 minutes.
A solution to use IAM with connection pooling and the mysql driver is described here https://github.com/go-sql-driver/mysql/issues/1354 but it involves using a custom connector. It seems to be using sql.OpenDB() instead of sql.Open().
Is there a way to use a custom connector with sqlx? I couldn't find a way to plug it in.
If not, is there a recommended way to use sqlx mysql connection pools with aws IAM?
By the looks of it, you can (probably) get what you need by creating your driver.Connector, passing that to sql.OpenDB(), and then passing the resulting sql.DB to sqlx.NewDB().
Hello,
We are using IAM Authentication in order to connect to an RDS mysql cluster. We are encountering a problem: the credentials that the connection pool is using have to be modified every 15 minutes, because AWS only provide tokens with a TTL of 15 minutes.
A solution to use IAM with connection pooling and the mysql driver is described here https://github.com/go-sql-driver/mysql/issues/1354 but it involves using a custom connector. It seems to be using sql.OpenDB() instead of sql.Open().
Is there a way to use a custom connector with sqlx? I couldn't find a way to plug it in.
If not, is there a recommended way to use sqlx mysql connection pools with aws IAM?
Thank you