[aws-rds] Unable to connect to database with default user after update to 1.65.0
We are using Aurora PostgreSQL and recently updated CDK from 1.63.0 to 1.66.0. After the update we haven't been able to connect to the database server with default user that is generated by RDS.
Based on our investigation it looks like this happened due to changes to RDS in CDK version 1.65.0 which caused the user's password to be re-generated, but it looks like this new password was not updated to the database. We could verify this by reading previous version of default user's database cluster secret and by connecting to the database with previous version of their password, which worked.
One reason for this might be that we have not enabled password rotation. As far as I can understand, password rotation works by an automatically generated Lambda function which updates the password in database. Now that default user's password was re-generated, there was nothing to perform that update in the database as well.
Reproduction Steps
Create RDS cluster without password rotation and update CDK to version 1.65.0.
What did you expect to happen?
If default user's password is re-generated by CDK, it should automatically be updated to the database as well even if password rotation is not enabled.
What actually happened?
Default user's password changed, but it was not updated to the database.
Environment
- Framework Version: 1.65.0
Other
I suppose the best way to deal with this situation would be to just enable password rotation and let automation deal with things? We have not tried this yet because if something unexpected happens, it could make matters worse.
This is a little bit inconvenient that this broke like this.
This is :bug: Bug Report
same thing happend to me yesterday, luckily it wasn't a production stack I just cdk destroyed it and deployed it from scratch
I have also observed this upgrading to 1.67.0. This ends up being quite bad and can permanently break entire systems if you're relying on the secret in secretsmanager to be the single source of truth.
That is actually a good point that I forgot to mention. We were also relying on host and port from said secret which suddenly disappeared. Only way to get around that was to export those values manually with CfnOutput. However release notes failed to mention this would happen.
@Urokhtor can we move this to #10800, as it seems to be the same issue?
Sure, that's all right.
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.