TypeORM AWS RDS Proxy Integration

1.9k Views Asked by At

I am trying to use RDS proxy with TypeORM in a nestjs application. RDS Proxy uses IAM authentication, because of which I am getting authentication error after 15 minutes. Please let me know if there is a way to make typeorm refresh the token before it gets expire. (Type orm is loaded as part of app module in the nestjs lambda function)

1

There are 1 best solutions below

1
On

you can give your ec2 access to your RDS via IAM Role.

If want to connect locally. No need to pass the credentials via code.

How can I connect to a private Amazon RDS DB instance from a local machine using an Amazon EC2 instance as a bastion host?

OR

  1. Install aws-cli.
  2. Run: aws configure.
  3. Add secret and access keys and session tokens, which should have access to your RDS. This will add your credentials under the .aws/credentials file(or look for credentials file).
  4. Write and run a background process that updates the credentials under credetails file before it expires.