Spring Boot: Handle AWS RDS Password Change or Rotation Without Restarting

This article is about how you can handle AWS RDS secrets rotation without restarting your Spring Boot application.

I had this problem wherein I had to update my database connection whenever the database password was updated for my AWS RDS instance. This can be because of a monthly password rotation policy or maybe the database credentials got compromised and you want all your running applications to keep running even when the database password is changed.