aws-cdk: [rds] Database Secret broken after upgrade to 1.67
After upgrading a stack from CDK 1.60 to 1.67 not only the password was regenerated without changing the database password (see https://github.com/aws/aws-cdk/issues/10716), also the values for host, port, dbName are entirely missing. Our application cannot access the DB anymore as all connection data was pulled from Secret Manager.
It seems like the changed ExcludeCharacters value caused a regenerate of the secret.
Environment
- CLI Version :
- Framework Version: 1.67.0
- Node.js Version: 14.11
- OS : MacOS 10.15.7
- Language (Version): TypeScript 4.0.3
This is đ Bug Report
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 12
- Comments: 34 (25 by maintainers)
@jogold Great tip, thanks so much!
The following worked for me:
This is how you can unblock yourself and upgrade (
databaseis ards.DatabaseInstanceorrds.DatabaseClusterin the code below).After this, if you need to reference your secret elsewhere in your code you can still use
database.secretas it references the attachment and not the secret itself.(your old secret remains in place and linked to your instance/cluster but for the username only: its password is now useless, not in sync with your database anymore)
This is the critical point for us right now - Weâre currently now stuck on an old version of CDK because we cannot upgrade without breaking multiple clusters simultaneously. We have a large number of CDK provisioned databases and fixing them all manually in some way is obviously less than ideal đ
Iâm happy to perform a fairly involved workaround as a once-off if we can devise one/to get us to a better place but havenât had time to devise/test much in this direction yet. Itâd be ideal if the workaround could be implemented âin-CDKâ so to speak rather than having to fiddle around externally (ie: direct AWS API manipulation/etc).