aws / aws-secretsmanager-jdbc

The AWS Secrets Manager JDBC Library enables Java developers to easily connect to SQL databases using secrets stored in AWS Secrets Manager.
Apache License 2.0
161 stars 77 forks source link

Support providing regions/endpoint configuration at connection-time #143

Open steve-thousand opened 1 year ago

steve-thousand commented 1 year ago

Currrently, configuration of the secrets manager region and endpoint needs to be done through system properties and environment variables. There are a few problems with this approach that I have run into:

  1. If ARNs ever have to be retrieved from different regions, the driver only supports one
  2. Setting the environment variables has been an issue in some environments, like when EMR runs your code in yarn containers

If region/endpoint could be provided as connection properties, the region/endpoint could be used dynamically.

jbct commented 1 year ago

Hi steve-thousand. Could you speak a bit more to your use case? What are you looking to have happen?

johnB96 commented 1 year ago

I work with Steve and can mention a use case we have. We want to use a read-only connection (denoted by -ro- in the url). Other consumers of the secrets manager resource need the read-write connection that we specify for host, however, we want certain processes to use the read-only connection, specified with a different key in the json but given this code looks for host only it can't use that read-only connection.