Skip to content

How to Handle RDS Key Rotation in a Node.js Application Deployed on EKS with EnvConfigmap

0

I have a problem with a Node application that is deployed in EKS, through manifests and environment variables (EnvConfigmap) applied to the cluster. For this application I am using RDS and the key is provided by secrets manager, it happens that when my key rotates then my pod is left without access to the database because it is not updated, then it is necessary to obtain the key again and replace it in the variables file environment and deploy again, I would like to know what solution I can give to this. I have read some such as changing the way to authorize myself in the RDS or installing external secrets operator in the cluster and connecting it with AWS, however I want different opinions and I would like to solve my problem in the best possible way

1 Answer
0

Hello Andres,

You have a Node.js application deployed on EKS, which connects to an RDS instance using credentials stored in AWS Secrets Manager. The issue is that when your RDS credentials rotate, your pods are not automatically updated, leading to database access failures.

So, here is the Possible solution: AWS Identity and Access Management (IAM) authentication allows applications to connect to an Amazon RDS database using temporary authentication tokens instead of storing static database credentials in AWS Secrets Manager or environment variables.

EKS Pod Uses IAM Role – The Kubernetes service account is linked to an IAM role with the necessary permissions.

App Requests Temporary Token – The application calls AWS STS (Security Token Service) to get a temporary authentication token.

App Connects to RDS – The application uses this IAM token instead of a password to establish a connection with RDS.

**Token Expires **– The IAM authentication token is valid for 15 minutes, after which the app must request a new token.

Thanks, Mahaboob.

EXPERT

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.