Skip to content

(rds): support for Aurora Serverless V2 #20197

@rpbarnes

Description

@rpbarnes

Describe the feature

Please like the original post instead of leaving a +1 comment.

Add CDK support for aurora serverless v2 ideally via the ServerlessCluster construct.

edit there's a few solutions using base cloud formation constructs in the comments. Please see those for a work around.

Currently deploying a Serverless V2 instance via cdk doesn't seem possible.

I've got this far

        enum ServerlessInstanceType {
            SERVERLESS = 'serverless',
        }
        type CustomInstanceType = ServerlessInstanceType | ec2.InstanceType;
        const CustomInstanceType = {
            ...ServerlessInstanceType,
            ...ec2.InstanceType,
        };

        this.serverlessCluster = new DatabaseCluster(
            this,
            'ServerlessClusterV2',
            {
                engine: DatabaseClusterEngine.auroraMysql({
                    version: AuroraMysqlEngineVersion.of(
                        '8.0.mysql_aurora.3.02.0'
                    ), // The new minor version of Database Engine.
                }),
                storageEncrypted: true,
                iamAuthentication: true,
                parameterGroup: ParameterGroup.fromParameterGroupName(
                    this,
                    'rdsClusterPrameterGroup',
                    'default.aurora-mysql8.0'
                ),
                storageEncryptionKey: new Key(this, 'dbEncryptionKey'),
                instanceProps: {
                    instanceType:
                        CustomInstanceType.SERVERLESS as unknown as InstanceType,
                    vpc: props.vpc,
                    vpcSubnets: {
                        subnetType: SubnetType.PRIVATE_ISOLATED,
                    },
                },
            }
        );

but I keep running into this error

Set the Serverless v2 scaling configuration on the parent DB cluster before creating a Serverless v2 DB instance.

Which I can't figure out a way around.

Use Case

Need to create a DB via CDK. I want to use Serverless V2 because of the support for mysql 8.0.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.15.0

Environment details (OS name and version, etc.)

mac OS X

Metadata

Metadata

Assignees

Labels

@aws-cdk/aws-rdsRelated to Amazon Relational Databaseeffort/largeLarge work item – several weeks of effortfeature-requestA feature should be added or improved.in-progressThis issue is being actively worked on.p1

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions