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

chore(rds): fix certificate enum values misspelling #30135

Merged
merged 4 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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