I’m on Spring boot and this is scenario:-
When I update (or rotate) my secrets, how does aws secret manager notify the
application that is using the secrets? I know I can fetch secret as done here.
I know if we use aws’s own JDBC, then it notifies the app, don’t know
how it does internally.
My goal is, how to notify , and make the app use the latest secrets, when I’m not
using aws’s JDBC (that is, without using aws-secretsmanager-jdbc)
I want to use connection pooling, without messing up with JDBC (and c3b0), for which I would just refresh context and rebuild my mysql jpa config object (connection object) with latest secrets.
2
Answers
At no point does SecretsManager do anything to "notify" your app. The Amazon JDBC driver just does a few things for you:
You would simply have to perform the same logic in your code if you don’t want to use the AWS JDBC driver. Note that the AWS JDBC driver is just a wrapper around another JDBC driver, so the AWS JDBC driver would still be using your current JDBC driver to make the actual database connections.
To properly support secret rotation, you should maintain two DB users with equivalent permissions: