1

Aurora Postgresql running on an AWS RDS has a token expiry time of 15 minutes. Unlike using a username and password to authenticate, if we use a token to authenticate as shown below, the Spring cloud function that I use authenticates but to connect and run a Spring boot application that retains the connection for extended periods of time, what is the solution to retain the connection? Because the token is expiring after 15 minutes, the Database connection is lost. Is there a way to extend this time?

RdsIamAuthTokenGenerator generator = RdsIamAuthTokenGenerator.builder()
                .credentials(new DefaultAWSCredentialsProviderChain()).region("us-west-1").build();

One of the potential solutions I've seen was to use actuators to periodically regenerate the token, but is there a more standard solution to this?

Running Actuator Refresh and Actuator Rebind, is actually solving the issue but I need to figure out a way to run it from the java spring boot on a scheduler basis. Looking to see if there are other more refined solutions to this.

Roe hit
  • 457
  • 1
  • 7
  • 23
  • did you find a solution for this? – Hurricane Apr 28 '22 at 07:25
  • Couldn't find it .... Still trying to figure out how to increase the token life .... would be great if someone can pitch in about this scenario. Token is not of much use if it cant live beyond 15 minutes and there is a process that goes beyond 15 minutes – Roe hit Apr 28 '22 at 12:46

0 Answers0