Skip to content

RDS: Cannot set ServerlessCluster minCapacity to 0.5 ACU #30309

@zmillman

Description

@zmillman

Describe the bug

The Aurora Serverless v2 docs say that you can set capacity to 0.5 ACUs:

The smallest Aurora Serverless v2 capacity that you can define is 0.5 ACUs. You can specify a higher number if it's less than or equal to the maximum capacity value. Setting the minimum capacity to a small number lets lightly loaded DB clusters consume minimal compute resources. At the same time, they stay ready to accept connections immediately and scale up when they become busy.

However, this can't be configured using the CDK node library (I'm using 2.140.0) because AuroraCapacityUnit is hardcoded to a fixed set of powers of 2 in aws-rds/lib/serverless-cluster.ts

Expected Behavior

I expected to be able to set minCapacity to 0.5

Current Behavior

Screenshot 2024-05-22 at 11 02 26 AM

Reproduction Steps

With aws-cdk-lib@2.140.0:

import {
  AuroraCapacityUnit,
  AuroraPostgresEngineVersion,
  DatabaseClusterEngine,
  ServerlessCluster,
} from "aws-cdk-lib/aws-rds";
import { Construct } from "constructs";

export class DB extends Construct {
  constructor(scope: Construct, id: string) {
    super(scope, id);

    new ServerlessCluster(this, "Database", {
      engine: DatabaseClusterEngine.auroraPostgres({
        version: AuroraPostgresEngineVersion.VER_13_12,
      }),
      scaling: {
        minCapacity: 0.5,
        maxCapacity: AuroraCapacityUnit.ACU_4,
      },
    });
  }
}

Possible Solution

Provide ACU_0_5 = 0.5 as an option for AuroraCapacityUnit

Additional Information/Context

No response

CDK CLI Version

2.140.0

Framework Version

No response

Node.js Version

v20.10.0

OS

MacOs

Language

TypeScript

Language Version

5.4.5

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-rdsRelated to Amazon Relational DatabasebugThis issue is a bug.effort/smallSmall work item – less than a day of effortp2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions