question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(rds): unable to alter master user password when using DatabaseClusterFromSnapshot with snapshotCredentials

See original GitHub issue

Describe the bug

About 2 months ago a this PR got merged, which states that we should be able to alter the master user password of the snapshot using the snapshotCredentials prop. However when using this prop CDK creates a new secret in Secrets Manager, but the master user password still remains unchanged. It seems like the DatabaseSecret that is created is not being used.

Looking at the code of the PR, the masterUserPassword gets changed in the cfnDbCluster while also having the snapshotIdentifier prop. However the docs state to NOT use the masterUserPassword prop together with the snapshotIdentifier prop.

Expected Behavior

When using the snapshotCredentials property with rds.SnapshotCredentials.fromGeneratedSecret() inside the DatabaseClusterFromSnapshot construct. I expect the master user password to be changed to the password that is generated in Secrets Manager.

Current Behavior

A DatabaseSecret is created inside Secrets Manger, however the master user password of the snapshot remains unchanged.

Reproduction Steps

  1. Create a RDS DB using Aurora Serverless using the DatabaseCluster construct in CDK
  2. Create snapshot
  3. Add DatabaseClusterFromSnapshot construct to CDK using the snapshotCredentials with SnapshotCredentials.fromGeneratedSecret(), and remove the DatabaseCluster construct from CDK
  4. Try logging in the DB as master user using the generated DatabaseSecret that is created from the DatabaseClusterFromSnapshot

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.27.0

Framework Version

No response

Node.js Version

16

OS

Linux

Language

Typescript

Language Version

No response

Other information

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:7
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
corymhallcommented, Sep 6, 2022

@MitchWijt I tried again today and it’s not working for me anymore. I’m not sure if something changed, or I just messed something up the last time I tried. After looking into it more, I’m not sure how it ever could have worked. In all of my testing, including with the integration test, it always uses the previous database password (which is inline with the documentation).

It seems like this issue impacts a significant number of customers, and I’ve tagged it as P1, which means it should be on our near-term roadmap.

We welcome community contributions! If you are able, we encourage you to contribute (https://github.com/aws/aws-cdk/blob/master/CONTRIBUTING.md) a bug fix or new feature to the CDK. If you decide to contribute, please start an engineering discussion in this issue to ensure there is a commonly understood design before submitting code. This will minimize the number of review cycles and get your code merged faster.

0reactions
corymhallcommented, Dec 23, 2022

I’ve not looked too much into this yet, but RDS just announced a new integration with secretsmanager https://aws.amazon.com/about-aws/whats-new/2022/12/amazon-rds-integration-aws-secrets-manager/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reset the master user password for an Amazon RDS DB ...
You can change the master user password for your DB instance using the RDS console. For clustered systems, such as Amazon Aurora, reset...
Read more >
aws-cdk.aws-rds · PyPI
By default, the master password will be generated and stored in AWS Secrets Manager with auto-generated description. Your cluster will be empty by...
Read more >
Cannot connect to aws rds Postgresql using master password ...
PAM is the tech used to implement IAM authentication. Are you sure the user you are connecting as is really the master user?...
Read more >
awsrds - Go Packages
Amazon Relational Database Service Construct Library. import rds "github.com/aws/aws-cdk-go/awscdk". Starting a clustered database.
Read more >
How do I reset my password for the master user in ... - YouTube
... Knowledge Center article with this video: https://aws.amazon.com/premiumsupport/knowledge-center/reset- master - user - password - rds /Mura...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found