-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
rds: Upgrade(2.142.0 -> 2.143.0) added an explicit dependency between some of our DB constructs. #30383
Comments
Yes that PR ensures the writer would always be created before the reader. Hi @mamta925 Did you mean you created this in const dbCluster = new rds.DatabaseCluster(this, "DbCluster", {
serverlessV2MinCapacity: 1,
serverlessV2MaxCapacity: 10,
writer: rds.ClusterInstance.serverlessV2("writer"),
readers: [rds.ClusterInstance.serverlessV2("reader")],
storageEncryptionKey: dbStorageEncryptionKmsKey,
removalPolicy: RemovalPolicy.DESTROY,
copyTagsToSnapshot: true,
clusterIdentifier: dbName,
securityGroups: [dbSecurityGroup],
credentials: dbClusterCredentials,
vpc,
vpcSubnets: privateSubnets,
defaultDatabaseName: dbDatabaseName,
engine: rds.DatabaseClusterEngine.auroraMysql({
version: rds.AuroraMysqlEngineVersion.VER_3_05_2,
}),
}); |
trying to reproduce this in my account |
Hi @mamta925 I created the cluster with 2.142.0 as below: export class DummyStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
const vpc = ec2.Vpc.fromLookup(this, 'Vpc', { isDefault: true });
const dbCluster = new rds.DatabaseCluster(this, "DbCluster", {
serverlessV2MinCapacity: 1,
serverlessV2MaxCapacity: 10,
writer: rds.ClusterInstance.serverlessV2("writer"),
readers: [rds.ClusterInstance.serverlessV2("reader")],
// storageEncryptionKey: dbStorageEncryptionKmsKey,
removalPolicy: RemovalPolicy.DESTROY,
copyTagsToSnapshot: true,
// clusterIdentifier: dbName,
// securityGroups: [dbSecurityGroup],
// credentials: dbClusterCredentials,
vpc,
// vpcSubnets: privateSubnets,
// defaultDatabaseName: dbDatabaseName,
engine: rds.DatabaseClusterEngine.auroraMysql({
version: rds.AuroraMysqlEngineVersion.VER_3_05_2,
}),
});
}
} Then I upgraded to 2.143.0. The
What made you think CFN was trying to delete and recreate the instance? |
Hi @mamta925 Can you elaborate on what made you think CFN was trying to delete and recreate the instance? Adding dependency should not cause the node replacement. |
This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
Describe the bug
In CDK upgrade
2.142.0
->2.143.0
2.142.0
->2.143.0
This upgrade added an explicit dependency between some of our DB constructs.
"DbDbClusterreaderB277327D": { "DeletionPolicy": "Delete", "DependsOn": [ "DbDbClusterwriterCE53952E", ], "Properties": { "DBClusterIdentifier": { "Ref": "DbDbCluster8FBC7FAD",
Now, cloudformation wants to delete and recreate the database in order to apply that change, which is obviously not convenient.
So… any ideas how we can deploy this change without deleting the DB and having to re-load the data?
Expected Behavior
It should not delete DB
Current Behavior
Stack update is failing because of DB recreation
Reproduction Steps
Our old DB constuct , now updating
cdk versions
Possible Solution
not sure if this is causing issue : #30260
Additional Information/Context
No response
CDK CLI Version
aws-cdk (source) devDependencies minor 2.142.0 -> 2.143.0
Framework Version
No response
Node.js Version
20
OS
Linux
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: