Skip to content
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

fix(rds): prevent rendering deprecated credentials when creating a database cluster from a snapshot (under feature flag) #27174

Merged
merged 10 commits into from
Sep 25, 2023

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,12 @@
"Type": "AWS::RDS::DBCluster",
"Properties": {
"CopyTagsToSnapshot": true,
"DBClusterParameterGroupName": "default.aurora-mysql5.7",
"DBClusterParameterGroupName": "default.aurora-mysql8.0",
"DBSubnetGroupName": {
"Ref": "ClusterSubnetsDCFA5CB7"
},
"Engine": "aurora-mysql",
"EngineVersion": "5.7.mysql_aurora.2.10.2",
"EngineVersion": "8.0.mysql_aurora.3.04.0",
"MasterUserPassword": {
"Fn::Join": [
"",
Expand Down Expand Up @@ -474,7 +474,7 @@
"DBClusterIdentifier": {
"Ref": "ClusterEB0386A7"
},
"DBInstanceClass": "db.t3.small",
"DBInstanceClass": "db.t3.medium",
"DBSubnetGroupName": {
"Ref": "ClusterSubnetsDCFA5CB7"
},
Expand All @@ -495,7 +495,7 @@
"DBClusterIdentifier": {
"Ref": "ClusterEB0386A7"
},
"DBInstanceClass": "db.t3.small",
"DBInstanceClass": "db.t3.medium",
"DBSubnetGroupName": {
"Ref": "ClusterSubnetsDCFA5CB7"
},
Expand Down Expand Up @@ -1357,42 +1357,6 @@
}
}
},
"FromSnapshotSecret9100F61C": {
"Type": "AWS::SecretsManager::Secret",
"Properties": {
"Description": {
"Fn::Join": [
"",
[
"Generated by the CDK for stack: ",
{
"Ref": "AWS::StackName"
}
]
]
},
"GenerateSecretString": {
"ExcludeCharacters": " %+~`#$&*()|[]{}:;<>?!'/@\"\\",
"GenerateStringKey": "password",
"PasswordLength": 30,
"SecretStringTemplate": "{\"username\":\"admin\"}"
}
},
"UpdateReplacePolicy": "Delete",
"DeletionPolicy": "Delete"
},
"FromSnapshotSecretAttachmentB62DA1C6": {
"Type": "AWS::SecretsManager::SecretTargetAttachment",
"Properties": {
"SecretId": {
"Ref": "FromSnapshotSecret9100F61C"
},
"TargetId": {
"Ref": "FromSnapshotEE0682C5"
},
"TargetType": "AWS::RDS::DBCluster"
}
},
"cdkintegclustersnapshotFromSnapshotSnapshotSecretD93327943fdaad7efa858a3daf9490cf0a702aeb": {
"Type": "AWS::SecretsManager::Secret",
"Properties": {
Expand Down Expand Up @@ -1486,12 +1450,12 @@
"Type": "AWS::RDS::DBCluster",
"Properties": {
"CopyTagsToSnapshot": true,
"DBClusterParameterGroupName": "default.aurora-mysql5.7",
"DBClusterParameterGroupName": "default.aurora-mysql8.0",
"DBSubnetGroupName": {
"Ref": "FromSnapshotSubnets9ED4B8EE"
},
"Engine": "aurora-mysql",
"EngineVersion": "5.7.mysql_aurora.2.10.2",
"EngineVersion": "8.0.mysql_aurora.3.04.0",
"MasterUserPassword": {
"Fn::Join": [
"",
Expand Down Expand Up @@ -1528,7 +1492,7 @@
"DBClusterIdentifier": {
"Ref": "FromSnapshotEE0682C5"
},
"DBInstanceClass": "db.t3.small",
"DBInstanceClass": "db.t3.medium",
"DBSubnetGroupName": {
"Ref": "FromSnapshotSubnets9ED4B8EE"
},
Expand All @@ -1549,7 +1513,7 @@
"DBClusterIdentifier": {
"Ref": "FromSnapshotEE0682C5"
},
"DBInstanceClass": "db.t3.small",
"DBInstanceClass": "db.t3.medium",
"DBSubnetGroupName": {
"Ref": "FromSnapshotSubnets9ED4B8EE"
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class TestStack extends Stack {
const vpc = new ec2.Vpc(this, 'Vpc', { maxAzs: 2, natGateways: 1, restrictDefaultSecurityGroup: false });

const instanceProps = {
instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.SMALL),
instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.MEDIUM),
isFromLegacyInstanceProps: true,
};
const cluster = new rds.DatabaseCluster(this, 'Cluster', {
engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_2_10_2 }),
engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_3_04_0 }),
writer: ClusterInstance.provisioned('Instance1', {
...instanceProps,
}),
Expand All @@ -42,7 +42,7 @@ class TestStack extends Stack {
const fromSnapshot = new rds.DatabaseClusterFromSnapshot(this, 'FromSnapshot', {
snapshotIdentifier: snapshoter.snapshotArn,
snapshotCredentials: rds.SnapshotCredentials.fromGeneratedSecret('admin'),
engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_2_10_2 }),
engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_3_04_0 }),
writer: ClusterInstance.provisioned('Instance1', {
...instanceProps,
}),
Expand Down
Loading
Loading