aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

[aws-rds] Unable to connect to database with default user after update to 1.65.0

Open Urokhtor opened this issue 6 years ago • 6 comments

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

Urokhtor avatar Oct 06 '20 06:10 Urokhtor

same thing happend to me yesterday, luckily it wasn't a production stack I just cdk destroyed it and deployed it from scratch

jonny-rimek avatar Oct 06 '20 11:10 jonny-rimek

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.

fennb avatar Oct 09 '20 05:10 fennb

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 avatar Oct 09 '20 13:10 Urokhtor

@Urokhtor can we move this to #10800, as it seems to be the same issue?

skinny85 avatar Oct 09 '20 16:10 skinny85

Sure, that's all right.

Urokhtor avatar Oct 09 '20 16:10 Urokhtor

⚠️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.

github-actions[bot] avatar Oct 09 '20 18:10 github-actions[bot]