Search code examples
amazon-rdsserverless-framework

How can I update the master Username and password of and existing AWS RDS cluster using the serverless-framework?


Can't update username of existing RDS cluster

Updating the masterUsername and masterUserPassword in the serverless.yml file for my postgresql database results in the password being updated but not the username.

i.e. I can only access the db with the old username and new password.

I am using the serverless framework to manage aws assests. It's an RDS cluster.

Everything builds successfully and I can access the data (using the old username).

Waiting for over 30 minutes doesn't have an effect.


Solution

  • I understand you want to update the MasterUsername property on an existing RDS instance that you created with Serverless Framework.

    Serverless Framework uses AWS CloudFormation. According to the AWS CF docs, the MasterUsername property cannot be updated on an existing RDS instance. Any attempt will result in a resource replacement.

    If you still want to update the MasterUsername, your only option is to destroy the RDS instance and create a new one.