Skip to content

Commit

Permalink
chore(rds): fix certificate enum values misspelling (#30135)
Browse files Browse the repository at this point in the history
Closes #30132

### Reason for this change

Slight misspelling of enum values.

### Description of changes

Fixed the name. Deprecated the old values. Changed values in tests & readmes

### Description of how you validated changes

No behavior change as underlying value is the same.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
scanlonp authored May 10, 2024
1 parent b2eb86c commit 495204f
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ new DatabaseCluster(stack, 'Database', {
password: SecretValue.unsafePlainText('7959866cacc02c2d243ecfe177464fe6'),
},
instanceType: instanceType,
caCertificate: CaCertificate.RDS_CA_RDS4096_G1,
caCertificate: CaCertificate.RDS_CA_RSA4096_G1,
vpcSubnets: { subnetType: SubnetType.PUBLIC },
vpc,
removalPolicy: RemovalPolicy.DESTROY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ new DatabaseInstance(stack, 'Instance', {
}),
instanceType: InstanceType.of(InstanceClass.T3, InstanceSize.MICRO),
vpc,
caCertificate: CaCertificate.RDS_CA_RDS2048_G1,
caCertificate: CaCertificate.RDS_CA_RSA2048_G1,
});

new integ.IntegTest(app, 'InstanceCACertificateTest', {
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-docdb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,6 @@ const cluster = new docdb.DatabaseCluster(this, 'Database', {
subnetType: ec2.SubnetType.PUBLIC,
},
vpc,
caCertificate: docdb.CaCertificate.RDS_CA_RDS4096_G1, // CA certificate for all instances under this cluster
caCertificate: docdb.CaCertificate.RDS_CA_RSA4096_G1, // CA certificate for all instances under this cluster
});
```
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-docdb/test/cluster.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('DatabaseCluster', () => {
password: cdk.SecretValue.unsafePlainText('tooshort'),
},
instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL),
caCertificate: CaCertificate.RDS_CA_RDS4096_G1,
caCertificate: CaCertificate.RDS_CA_RSA4096_G1,
vpc,
});

Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-docdb/test/instance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('DatabaseInstance', () => {
new DatabaseInstance(stack, 'Instance', {
cluster: stack.cluster,
instanceType: SINGLE_INSTANCE_TYPE,
caCertificate: CaCertificate.RDS_CA_RDS4096_G1,
caCertificate: CaCertificate.RDS_CA_RSA4096_G1,
});

// THEN
Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-rds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ declare const vpc: ec2.Vpc;
const cluster = new rds.DatabaseCluster(this, 'Database', {
engine: rds.DatabaseClusterEngine.auroraMysql({ version: rds.AuroraMysqlEngineVersion.VER_3_01_0 }),
writer: rds.ClusterInstance.provisioned('writer', {
caCertificate: rds.CaCertificate.RDS_CA_RDS2048_G1,
caCertificate: rds.CaCertificate.RDS_CA_RSA2048_G1,
}),
readers: [
rds.ClusterInstance.serverlessV2('reader', {
Expand Down Expand Up @@ -527,7 +527,7 @@ declare const vpc: ec2.Vpc;
new rds.DatabaseInstance(this, 'Instance', {
engine: rds.DatabaseInstanceEngine.mysql({ version: rds.MysqlEngineVersion.VER_8_0_30 }),
vpc,
caCertificate: rds.CaCertificate.RDS_CA_RDS2048_G1,
caCertificate: rds.CaCertificate.RDS_CA_RSA2048_G1,
});
```

Expand Down
14 changes: 14 additions & 0 deletions packages/aws-cdk-lib/aws-rds/lib/ca-certificate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,28 @@ export class CaCertificate {

/**
* rds-ca-rsa2048-g1 certificate authority
*
* @deprecated use RDS_CA_RSA2048_G1 (slight misspelling)
*/
public static readonly RDS_CA_RDS2048_G1 = CaCertificate.of('rds-ca-rsa2048-g1');

/**
* rds-ca-rsa2048-g1 certificate authority
*/
public static readonly RDS_CA_RSA2048_G1 = CaCertificate.of('rds-ca-rsa2048-g1');

/**
* rds-ca-rsa4096-g1 certificate authority
*
* @deprecated use RDS_CA_RSA4096_G1 (slight misspelling)
*/
public static readonly RDS_CA_RDS4096_G1 = CaCertificate.of('rds-ca-rsa4096-g1');

/**
* rds-ca-rsa4096-g1 certificate authority
*/
public static readonly RDS_CA_RSA4096_G1 = CaCertificate.of('rds-ca-rsa4096-g1');

/**
* Custom CA certificate
*
Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-rds/test/cluster.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1154,11 +1154,11 @@ describe('cluster new api', () => {
vpc,
writer: ClusterInstance.provisioned('writer', {
instanceType: ec2.InstanceType.of(ec2.InstanceClass.M5, ec2.InstanceSize.XLARGE24 ),
caCertificate: CaCertificate.RDS_CA_RDS4096_G1,
caCertificate: CaCertificate.RDS_CA_RSA4096_G1,
}),
readers: [
ClusterInstance.serverlessV2('reader', {
caCertificate: CaCertificate.RDS_CA_RDS2048_G1,
caCertificate: CaCertificate.RDS_CA_RSA2048_G1,
}),
ClusterInstance.provisioned('reader2', {
promotionTier: 1,
Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-rds/test/instance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2053,7 +2053,7 @@ describe('instance', () => {
engine: rds.DatabaseInstanceEngine.mysql({ version: rds.MysqlEngineVersion.VER_8_0_30 }),
instanceType: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.SMALL),
vpc,
caCertificate: rds.CaCertificate.RDS_CA_RDS2048_G1,
caCertificate: rds.CaCertificate.RDS_CA_RSA2048_G1,
});

Template.fromStack(stack).hasResourceProperties('AWS::RDS::DBInstance', {
Expand Down

0 comments on commit 495204f

Please sign in to comment.