skip to Main Content

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)

enter image description here

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


  1. Chosen as BEST ANSWER

    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


  2. You have two issues with your cloudformation template:

    1 – EngineMode: serverless : the default engine mode for V2 is provisioned not serverless which the ServerlessV2ScalingConfiguration 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 like provisioned, parallelquery, or global. If you attempt to include it, you will encounter a validation or runtime error because Aurora Serverless v2 does not require or support this property.

    2 – ScalingConfiguration: this is for V1, V2 uses ServerlessV2ScalingConfiguration instead .

    this is a sample template which is already tested and working:

    AWSTemplateFormatVersion: '2010-09-09'
    Resources:
      AuroraServerlessCluster:
        Type: 'AWS::RDS::DBCluster'
        Properties:
          Engine: aurora-mysql
          EngineVersion: 8.0.mysql_aurora.3.08.0 
          DatabaseName: testdb
          MasterUsername: admin
          MasterUserPassword: Password123!
          ServerlessV2ScalingConfiguration: # Aurora Serverless v2 scaling configuration
            MinCapacity: 0.5
            MaxCapacity: 8
          EnableHttpEndpoint: true
          EnableIAMDatabaseAuthentication: true
          StorageEncrypted: true
          BackupRetentionPeriod: 1
    
    Outputs:
      ClusterEndpoint:
        Value: !GetAtt AuroraServerlessCluster.Endpoint.Address
        Description: "The endpoint of the Aurora Serverless Cluster."
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search