vinz

Just yesterday Amazon has announced the V2 of Aurora Serverless Database. How manage it with CDK using the current (v2.20.0) aws-cdk typescript library which doesn’t yet support it?

There the code:

import * as ec2 from 'aws-cdk-lib/aws-ec2';
import * as rds from 'aws-cdk-lib/aws-rds';
// Expedient to set DB Cluster Instance as Serverless.enum ServerlessInstanceType { SERVERLESS = 'serverless',}type CustomInstanceType = ServerlessInstanceType | ec2.InstanceType;const CustomInstanceType = { ...ServerlessInstanceType, ...ec2.InstanceType };
new rds.DatabaseCluster(this, 'cluster-name', {
clusterIdentifier: 'cluster-name',engine: rds.DatabaseClusterEngine.auroraMysql({version: rds.AuroraMysqlEngineVersion.of('8.0.mysql_aurora.3.02.0'), // The new minor version of Database Engine.}),credentials: rds.Credentials.fromGeneratedSecret('admin'),instanceProps: {instanceType:CustomInstanceType.SERVERLESS as unknown as ec2.InstanceType},instances: 1,});

--

--