Creating an Aurora Serverless Cluster from cloudfo

2020-02-01 00:00发布

From Aurora Serverless's document, there are 3 ways to create an Aurora serverless DB cluster: AWS management console, CLI, and RDS API. (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/aurora-serverless.create.html)

Form my understanding, one would use EngineMode in the RDS API to create Aurora Serverless, but this property is not available in AWS::RDS::DBCluster yet (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html).

Would it be possible to create an Aurora Serverless Cluster from cloudformation? Any advice would be appreciated!

4条回答
爷的心禁止访问
2楼-- · 2020-02-01 00:06

It is now possible to create an AWS::RDS::DBCluster with an EngineMode set to serverless. See more here: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html#cfn-rds-dbcluster-enginemode

查看更多
霸刀☆藐视天下
3楼-- · 2020-02-01 00:22

Simple answer - No. Not till they make it available in CFN. As of 1-2 days ago, the EngineMode and ScalingConfiguration property are not yet available in the RDS API, as my API call threw this error. First they will make available the APIs/cli. Once that works, create a CFN Custom Resource to invoke the RDS API from a lambda. It might be a while before it is made directly available in CFN.

2018-08-15T16:12:09.648Z f57erb2b-g3a5-11e8-8f64-81912181e535 { MultipleValidationErrors: There were 2 validation errors: * UnexpectedParameter: Unexpected key 'EngineMode' found in params * UnexpectedParameter: Unexpected key 'ScalingConfiguration' found in params

And I know role/permission is not a problem as I could launch normal Aurora cluster from the same.

PS: RDS APIs now work for serverless

Edit: Some time in Oct 18, EngineMode added to CFN, so now this is possible -> https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html#cfn-rds-dbcluster-enginemode

查看更多
成全新的幸福
4楼-- · 2020-02-01 00:29

Thanks for Chris's update. As an example, here is my cloudFormation template for serverless aurora. We no longer need the DBInstance.

  RDSCluster:
    Type: AWS::RDS::DBCluster
    Properties:
      MasterUsername: 
        Ref: DBUsername
      MasterUserPassword: 
        Ref: DBPassword
      DatabaseName: RANDOMNAME
      Engine: aurora
      EngineMode: serverless
      ScalingConfiguration:
        AutoPause: true
        MaxCapacity: 16
        MinCapacity: 2
        SecondsUntilAutoPause: 300
      DBSubnetGroupName:
        Ref: DBSubnetGroup

More complete example of all available options for RDS (including Aurora): https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbcluster.html

查看更多
我想做一个坏孩纸
5楼-- · 2020-02-01 00:29

I found an article that indicated that the Go SDK has been updated with the EngineMode parameter, and when I looked through the AWS SDK changelog, I found some RDS updates in the most recent versions. I've had to manually update my AWS CLI to the latest release to get my shell scripts working with that option.

https://github.com/aws/aws-cli/releases

https://github.com/aws/aws-cli/blob/develop/CHANGELOG.rst

https://github.com/terraform-providers/terraform-provider-aws/issues/5503

No news on the CloudFormation side though.

查看更多
登录 后发表回答