cloudformation-coverage-roadmap
cloudformation-coverage-roadmap copied to clipboard
AWS::RDS::DBCluster ServerlessV2
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.
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.
+1
+1
+1 :)
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.
+1
+1
+1
+1
+1
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
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 theAWS::RDS::DBCluster
. - If you want v2 serverless, you need to set
DBInstanceClass: db.serverless
on aAWS::RDS::DBInstance
referencing the cluster, and DO NOT SETEngineMode: 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 theDBCluster
gives an error. This field sounds like a shorthand for creating a separateAWS::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