-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws_rds: DatabaseClusterFromSnapshot creates a new secret when using SnapshotCredentials.fromSecret() #23815
Comments
Thanks for your report. I will try reproduce this in my account. |
Having the same issue.
After this I'm dumping the Secret ARN into SSM by using cluster.secret.secretFullArn. "aws-cdk-lib": "2.38.1" |
As |
Out of curiosity, is there any update on this issue? We would like to update our version of the library, but newer versions have deprecated Since secret rotation is mandatory for us, but since we have no control over the second, extra secret resulting from using |
@dominiquems I'm looking into this to see what we can do to prevent the extra secret from being created. |
…tabase cluster from a snapshot (under feature flag) (#27174) This PR fixes a bug where an extra database secret is being generated when an RDS database cluster is being created from a snapshot. On the `DatabaseClusterFromSnapshotProps` interface, we deprecated the `credentials` property and, at the same, introduced `snapshotCredentials` as the recommended replacement. However, the default behavior associated with the `credentials` property was not removed as doing so would introduce a breaking change for some users as detailed in this [PR](#20777). As a result, users just using the recommended `snapshotCredentials` property to create a new RDS database cluster are seeing an extra, unwanted secret being created. Closes #23815 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the bug
If I create a new secret in a stack and provide it to
rds.DatabaseCluster
using the propertycredentials: rds.Credentials.fromSecret(secret)
, the secret is attached correctly to the new database cluster.However, if I provide the same secret to
rds.DatabaseClusterFromSnapshot
using the propertysnapshotCredentials: rds.SnapshotCredentials.fromSecret(secret)
, a new additional secret is also created and attached to the database cluster.Expected Behavior
rds.DatabaseClusterFromSnapshot
uses the secret provided insnapshotCredentials
and does not create any additional resources.Current Behavior
rds.DatabaseClusterFromSnapshot
creates a new secret even whensnapshotCredentials
refers to an existing secret. TwoAWS::SecretsManager::SecretTargetAttachment
resources are created, one using the provided existing secret and one using the newly created unnecessary secret.Reproduction Steps
This minimal stack reproduces the problem:
When running
cdk diff
, the resource list output will contain two Secrets/Attachments, not one as expected:Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.61.1 (build d319d9c)
Framework Version
No response
Node.js Version
v18.13.0
OS
macOS Monterey (arm64)
Language
Typescript
Language Version
TypeScript (4.9.4)
Other information
No response
The text was updated successfully, but these errors were encountered: