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

PostgreSQL driver enhancement for addressing Alternating User Rotation with RDS Proxy #222

Closed canelzio closed 10 months ago

canelzio commented 11 months ago

Discussed in https://github.com/aws/aws-secretsmanager-jdbc/discussions/221

Originally posted by **canelzio** December 27, 2023 Hi, I'm facing an issue using AWS SecretsManager JDBC driver with RDS Proxy and Alternating User secret rotation. It seems that RDS Proxy is not able to handle properly such rotation since it is limited to fetch only the AWSCURRENT secret version stage, and this leads to the following error: > org.postgresql.util.PSQLException: FATAL: This RDS proxy has no credentials for the role . Check the credentials for this role and try again. I've already opened a Feature Request to AWS on this, but in the meantime I'd like to discuss such topic with you. In my opinion everything should work as expected if the driver could intercept also the above error as an authentication error and refresh the secret cache accordingly. What do you think? Could this be feasible? Any other idea? Thank you.