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

Add docs on configuring underlying secret cache #168

Closed saikatak closed 1 year ago

saikatak commented 1 year ago

Currently when using these wrapper drivers implemented by this project there is no notes on how the Driver can be instantiated with custom cache manager having a ttl value configured by the user.

Would request to add notes on the same. In case if such instantiation is not supported. Can we add the support for the same

simonmarty commented 1 year ago

This is already possible through this constructor.

simonmarty commented 1 year ago

There are already docs on this here

To configure the cache, see SecretCacheConfiguration.

mbucc commented 7 months ago

@simonmarty

How do I configure the cache when using a connection pool such as the c3p0 examples provided in the README?

I'm asking on this ticket because this is where Google sent when trying to figure this out.

Issue https://github.com/aws/aws-secretsmanager-jdbc/discussions/214 suggests that the sample pool configuration given in the README does not enable the cache. That jibes with my reading of the code, as I didn't see anything related to caching in JDBCSecretCacheBuilderProvider.

While https://github.com/aws/aws-secretsmanager-jdbc/discussions/214 is discussing Hikari, https://github.com/aws/aws-secretsmanager-jdbc/issues/13#issuecomment-749447785 shows that the Hikari pool works fine with this AWS library (as expected). If you could provide an example of how I should configure the cache when using a connection pool, that would be much appreciated.

Is it only possible to do programmatically?