I am trying to define a serverless Aurora database in clousdformation. I want to make use of the latest EngineVersion which allows you to set the MinCapacity to 0. (Screenshot attached of console detailing the config I wish to create in CF)
Here is my CF:
AuroraServerlessCluster:
Type: 'AWS::RDS::DBCluster'
Properties:
Engine: aurora
EngineMode: serverless
EngineVersion: 8.0.mysql_aurora.3.08.0
DatabaseName: !Sub "aurora-database-${Environment}"
MasterUsername: admin
MasterUserPassword: password
ScalingConfiguration:
AutoPause: true
MinCapacity: 0
MaxCapacity: 4
SecondsUntilAutoPause: 300
EnableHttpEndpoint: true
EnableIAMDatabaseAuthentication: true
StorageEncrypted: true
But I keep getting the following error with no other errors or further information in the console…
The following resource(s) failed to create: [AuroraServerlessCluster].
The Engine version I got from the query:
aws rds describe-db-engine-versions --engine aurora --query "DBEngineVersions[].EngineVersion"
Which is referenced in the docs here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html#cfn-rds-dbcluster-engineversion
Any ideas why the cloudformation template is not valid?
2
Answers
The functionality is not yet available in cloudformation. The issue has been raised with AWS and progress can be seen here:
https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/2202
Further details outlined in this AWS post:
https://repost.aws/questions/QUbmRw5NGTR1ubycMnEQhtAQ#ANWjJk5qbVR1WoYpy_Mr_Otw
You have two issues with your cloudformation template:
1 –
EngineMode
:serverless
: the default engine mode for V2 isprovisioned
notserverless
which theServerlessV2ScalingConfiguration
implicitly activates Serverless v2 functionality, which works on top of the default provisioned mode.The EngineMode property is only valid for Aurora
Serverless
v1
and other configurations likeprovisioned
,parallelquery
, orglobal
. If you attempt to include it, you will encounter a validation or runtime error because AuroraServerless
v2 does not require or support this property.2 –
ScalingConfiguration
: this is for V1, V2 usesServerlessV2ScalingConfiguration
instead .this is a sample template which is already tested and working: