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

DatabaseCluster: serverlessV2MinCapacity should allow scaling to 0 #32234

Closed
1 of 2 tasks
tehnrd opened this issue Nov 21, 2024 · 3 comments · Fixed by #32231
Closed
1 of 2 tasks

DatabaseCluster: serverlessV2MinCapacity should allow scaling to 0 #32234

tehnrd opened this issue Nov 21, 2024 · 3 comments · Fixed by #32231
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Comments

@tehnrd
Copy link

tehnrd commented Nov 21, 2024

Describe the feature

Aurora Serverless V2 now allows scaling to zero (https://aws.amazon.com/blogs/database/introducing-scaling-to-0-capacity-with-amazon-aurora-serverless-v2/), but there is validation in CDK that prevents any values less than 0.5.

This validation needs to be removed.

Use Case

You should be able to scale the Aurora Serverless V2 cluster to 0.

Proposed Solution

Modfity /packages/aws-cdk-lib/aws-rds/lib/cluster.ts and remove the greater that 0.5 validation.

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.168.0

Environment details (OS name and version, etc.)

OSX 15.0 (24A335)

@tehnrd tehnrd added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Nov 21, 2024
@github-actions github-actions bot added the @aws-cdk/aws-rds Related to Amazon Relational Database label Nov 21, 2024
@pahud
Copy link
Contributor

pahud commented Nov 21, 2024

This feature is amazing and I've seen @mazyu36 on #32231

Thank you.

@pahud pahud added p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Nov 21, 2024
@tmokmss
Copy link
Contributor

tmokmss commented Nov 22, 2024

Workaround to avoid the validation:

    const cluster = new rds.DatabaseCluster(this, 'Cluster', {
      engine,
      vpc,
      serverlessV2MinCapacity: 0.5,
      serverlessV2MaxCapacity: 2.0,
      writer: rds.ClusterInstance.serverlessV2(this.writerId, {
        autoMinorVersionUpgrade: true,
        publiclyAccessible: false,
      }),
      storageEncrypted: true,
      removalPolicy: RemovalPolicy.DESTROY,
      parameterGroup: new rds.ParameterGroup(this, 'ParameterGroup', {
        engine,
        parameters: {
          // Terminate idle session for Aurora Serverless V2 auto-pause
          idle_session_timeout: '60000',
        },
      }),
    });
    // ADD THIS!
    (cluster.node.defaultChild as CfnResource).addPropertyOverride('ServerlessV2ScalingConfiguration.MinCapacity', 0);

@mergify mergify bot closed this as completed in #32231 Nov 23, 2024
@mergify mergify bot closed this as completed in d1b07d9 Nov 23, 2024
Copy link

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 23, 2024
mazyu36 added a commit to mazyu36/aws-cdk that referenced this issue Nov 27, 2024
Closes aws#32234.

Amazon Aurora Serverless v2 supports scaling to zero capacity.

Ref: https://aws.amazon.com/about-aws/whats-new/2024/11/amazon-aurora-serverless-v2-scaling-zero-capacity/

"Updated validation to permit zero as a value for `serverlessV2MinCapacity`.

Fix unit tests and add an integ test.

- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
@aws-cdk/aws-rds Related to Amazon Relational Database effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants