cloudformation-coverage-roadmap icon indicating copy to clipboard operation
cloudformation-coverage-roadmap copied to clipboard

AWS::RDS::DBCluster ServerlessV2

Open MrSakhs opened this issue 2 years ago • 10 comments

Name of the resource

AWS::RDS::DBCluster

Resource name

No response

Description

Amazon Aurora Serverless v2 is generally available was announced on the 21st of April (a week ago). This is feature request for CloudFormation to cover the gap and support Aurora Serverless V2 on the resource AWS::RDS:DBCluster, just like serverless version 1 is supported.

Example for Serverless Version 1 found here "Creating an Amazon Aurora Serverless DB cluster "

Other Details

I am not clear if the issue 1150 is covering this, but the focus is on AWS::RDS::DBInstance. Please check on this.

MrSakhs avatar Apr 27 '22 08:04 MrSakhs

For context, the main issue preventing us from deploying Serverless v2 with CloudFormation is the lack of support for the ServerlessV2ScalingConfiguration configuration property on the cluster. This property must be present on an AWS::RDS::DBCluster resource before we can deploy a db.serverless instance into it, otherwise the deployment fails due to missing configuration.

robertrossmann avatar May 03 '22 09:05 robertrossmann

+1

cmesas avatar May 09 '22 09:05 cmesas

+1

rsung-deepwatch avatar May 31 '22 12:05 rsung-deepwatch

+1 :)

huwd avatar Jun 16 '22 08:06 huwd

Please use thumbs up on the first post. "+1" or "any news" are discouraged. From the repo readme:

Q: Can I "+1" existing issues?

A:We strongly encourage you to do so, as it helps us understand which
issues will have the widest impact. You can navigate to the issue details
page and add a reaction (thumbs up). There are six types of reactions
supported (thumbs down “-1”, confused, heart, watching, laugh, hooray,
and thumbs up +1). We can typically do 8-10 items per month with all
necessary regression testing, and we want you to help us decide which
items will benefit you the most.

siebrand avatar Jun 16 '22 08:06 siebrand

+1

shanemacphillamy avatar Jun 19 '22 22:06 shanemacphillamy

+1

VanDuursenTopicus avatar Jun 23 '22 08:06 VanDuursenTopicus

+1

ClaudenirFreitas avatar Jul 11 '22 13:07 ClaudenirFreitas

+1

snakelab avatar Jul 20 '22 13:07 snakelab

+1

Beagle avatar Aug 25 '22 04:08 Beagle

Looks like we are sorted! https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html#cfn-rds-dbcluster-serverlessv2scalingconfiguration

Example - AWS::RDS::DBCluster - Creating an Amazon Aurora Serverless v2 DB cluster

MrSakhs avatar Oct 10 '22 13:10 MrSakhs

First, thx for the example link in the last comment @MrSakhs, that gave it finally away. While this is not entirely impossible indeed, the current implementation feels way too fragile.

TLDR:

  • If you want v1 serverless, you need to set EngineMode: serverless on the AWS::RDS::DBCluster.
  • If you want v2 serverless, you need to set DBInstanceClass: db.serverless on a AWS::RDS::DBInstance referencing the cluster, and DO NOT SET EngineMode: serverless
  • Having EngineMode: serverless locks you in into v1 serverless. As if v2 would not be serverless. If you want v2 serverless, you should not use engine mode serverless.

Thoughts:

  • If both are called serverless, and they only differ in a version, wouldn't it be a better abstraction to have a ServerlessVersion property?
  • Or couldn't at least CFN take the presence of the ServerlessV2ScalingConfiguration property as a hint for v2?
  • Also simply using a DBClusterInstanceClass property on the DBCluster gives an error. This field sounds like a shorthand for creating a separate AWS::RDS::DBInstance, but it is not behaving that way when it comes to serverless :/
Resources:
  ...
  DatabaseInstance1:
    Type: AWS::RDS::DBInstance
    Properties:
      DBClusterIdentifier: !Ref RDSCluster
      Engine: aurora-postgresql
      DBInstanceClass: db.serverless  # Need this to signal Serverless v2
  RDSCluster:
    Type: AWS::RDS::DBCluster
    Properties:
      DBClusterIdentifier: !Ref DBClusterName
      # DBClusterInstanceClass: db.serverless  # DONT SET! Needs a separate 'AWS::RDS::DBInstance' to set it
      MasterUsername: !Join ['', ['{{resolve:secretsmanager:', !Ref DBSecret, ':SecretString:username}}' ]]
      MasterUserPassword: !Join ['', ['{{resolve:secretsmanager:', !Ref DBSecret, ':SecretString:password}}' ]]
      DatabaseName: !Ref DatabaseName
      Engine: aurora-postgresql
      # EngineMode: serverless  # DONT SET! Enforces Serverless v1
      EngineVersion: 13.6
      ServerlessV2ScalingConfiguration:
        MinCapacity: 0.5
        MaxCapacity: 2
      DBSubnetGroupName:
        Ref: DBSubnetGroup

vhermecz avatar Jan 27 '23 08:01 vhermecz