Comments (3)
First off, you should never hard-code the AWS access key and AWS secret key. See https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html for AWS access key best practices. If you are running on an EC2 instance or in a Lambda, please take advantage of the instance role (for EC2) or the execution role (for Lambda). For everywhere else, follow the best practices regarding credentials files/environment variables.
Now back to your original question. The short answer is yes, this is possible. You would just deregister the existing driver and register the new driver that is instantiated with your own SDK client. For example:
// Deregister the driver first
Enumeration<Driver> drivers = DriverManager.getDrivers();
if (drivers != null) {
while (drivers.hasMoreElements()) {
Driver driver = drivers.nextElement();
if (driver.getClass() == AWSSecretsManagerPostgreSQLDriver.class) {
DriverManager.deregisterDriver(driver);
}
}
}
// Register new driver
AWSSecretsManager client = AWSSecretsManagerClientBuilder.standard()
.withRegion(Regions.US_EAST_2)
.build();
DriverManager.registerDriver(new AWSSecretsManagerPostgreSQLDriver(client));
Hope that answers your question.
from aws-secretsmanager-jdbc.
It has been 3 weeks so I'm assuming your question was answered. I'm going to resolve this issue.
from aws-secretsmanager-jdbc.
Is this the only solution for the work-around ?
The solution provided is 2 years back, Is there any update on this ?
AWSSecretsManagerPostgreSQLDriver is a final class, so I cant extend that.
But there are constructors which take parameters like AWSSecretsManager client. I need to know the way, how to use them.
from aws-secretsmanager-jdbc.
Related Issues (20)
- Add support for Snowflake HOT 1
- Support Java 17 HOT 1
- Secret not getting refreshed HOT 10
- Allow means to specify AWS profile other than `default` HOT 1
- JaCoCo added as a non-scoped transitive dependency HOT 1
- Support providing regions/endpoint configuration at connection-time HOT 2
- using MySQL `autoReconnect=true` configuration results in unhandled access denied errors HOT 1
- Add docs on configuring underlying secret cache HOT 3
- Vendor app based on Java running in AWS EKS to connect to RDS Oracle using Secrets Manager HOT 4
- AWSSecretsManagerPostgreSQLDriver incorrectly constructs URL when dbname is missing
- Connection from AWS EKS Fargate to Secrets Manager without using an AWS_ACCESS_KEY. HOT 5
- Springboot - Exception encountered during context initialization HOT 1
- PostgreSQL driver enhancement for addressing Alternating User Rotation with RDS Proxy
- provide option to enforce ssl
- Configurable backup region/failover option HOT 1
- dbInstanceIdentifier property of a Postgres AWS RDS Secret is not read from rds secret HOT 2
- Using MySQL driver fails when using Liquibase Maven plugin HOT 1
- AWS Secrets Manager Postgress SQL Driver not working in springboot HOT 2
- No Driver has been registered with name, com.mysql.cj.jdbc.Driver HOT 1
- Could not refresh secret manager Got error Cannot begin a subsegment without an initialized segment when password changed HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-secretsmanager-jdbc.