Is there a way to connect to an RDS instance using the aws-secretsmanager-jdbc with node.js? I need to connect to a datasource and run a simple query, but unfortunately the only supported way to connect is using aws-secretsmanager-jdbc.
https://github.com/aws/aws-secretsmanager-jdbc
I was thinking I could use this node module to connect: https://www.npmjs.com/package/jdbc, like this:
var JDBC = require('jdbc');
var jinst = require('jdbc/lib/jinst');
if (!jinst.isJvmCreated()) {
jinst.addOption("-Xrs");
jinst.setupClasspath(['./drivers/hsqldb.jar',
'./drivers/derby.jar',
'./drivers/derbyclient.jar',
'./drivers/derbytools.jar']);
}
var config = {
url: 'jdbc-secretsmanager:postgresql://therdshost:1234/mydbname',
// Not sure what to use for drivername here
drivername: '',
minpoolsize: 10,
maxpoolsize: 100,
user: 'myusername',
password: '',
properties: {}
};
var hsqldb = new JDBC(config);
hsqldb.initialize(function(err) {
if (err) {
console.log(err);
}
});
Looking at jdbc-secretsmanager, it seems that this is a separate Java library. Is it possible to do this in node.js or must I use Java for this?