All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ADB::DBCluster

Last Updated:Apr 09, 2025

ALIYUN::ADB::DBCluster is used to create an AnalyticDB for MySQL cluster.

Syntax

{
  "Type": "ALIYUN::ADB::DBCluster",
  "Properties": {
    "DBNodeStorage": Integer,
    "PeriodType": String,
    "DBClusterCategory": String,
    "ZoneId": String,
    "ResourceGroupId": String,
    "VPCId": String,
    "VSwitchId": String,
    "Mode": String,
    "DBClusterDescription": String,
    "ComputeResource": String,
    "Period": Integer,
    "PayType": String,
    "ElasticIOResource": Integer,
    "DBClusterVersion": String,
    "DBNodeGroupCount": Integer,
    "ExecutorCount": Integer,
    "DBClusterClass": String,
    "Tags": List
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

DBClusterCategory

String

Yes

Yes

The edition.

Valid values:

  • Cluster: reserved mode for Cluster Edition.

    Note

    Clusters in reserved mode for Cluster Edition are supported only in regions inside the Chinese mainland and the Singapore region. You can purchase clusters in reserved mode for Cluster Edition only on a pay-as-you-go basis in the Singapore region.

  • MixedStorage: elastic mode for Cluster Edition.

    Note

    If you set DBClusterCategory to Cluster, you must set Mode to Reserver. If you set DBClusterCategory to MixedStorage, you must set Mode to Flexible. Otherwise, the cluster fails to be created.

For more information, see Editions.

DBClusterVersion

String

Yes

No

The version of the cluster.

Set the value to 3.0.

Mode

String

Yes

No

The mode.

Valid values:

  • Reserver: reserved mode.

  • Flexible: elastic mode.

    Note

    If you do not specify this property, the default value Reserver is used.

PayType

String

Yes

No

The billing method.

Valid values:

  • Postpaid: pay-as-you-go.

  • Prepaid: subscription.

VPCId

String

Yes

No

The ID of the virtual private cloud (VPC).

None.

VSwitchId

String

Yes

No

The ID of the vSwitch.

None.

ComputeResource

String

No

Yes

The computing resource.

This property must be specified when Mode is set to Flexible.

Note

You can call the DescribeAvailableResource operation to query computing resources that are available in a specific region.

DBClusterClass

String

No

Yes

The model of the cluster.

Valid values:

  • C8

  • C32

Note

This property must be specified when Mode is set to Reserver.

DBClusterDescription

String

No

No

The description.

None.

DBNodeGroupCount

Integer

No

Yes

The number of node groups.

The value of this property must be an integer that ranges from 1 to 200.

Note

This property must be specified when Mode is set to Reserver.

DBNodeStorage

Integer

No

Yes

The storage capacity of the node.

This property must be specified only when Mode is set to Reserver.

Unit: GB.

Valid values:

  • Valid values when DBClusterClass is set to C8: 100 to 1000.

  • Valid values when DBClusterClass is set to C32: 100 to 8000.

Note

The storage capacity smaller than 1,000 GB increases in increments of 100 GB. The storage capacity larger than 1,000 GB increases in increments of 1,000 GB.

ElasticIOResource

Integer

No

Yes

The number of elastic I/O units (EIUs).

This property must be specified only when Mode is set to Flexible.

For more information, see Scale out elastic I/O resources.

ExecutorCount

Integer

No

No

The number of compute nodes that are used by the cluster in elastic mode.

None.

Period

Integer

No

No

The subscription duration.

This property must be specified only when PayType is set to Prepaid.

Valid values:

  • Valid values when PeriodType is set to Month: 1 to 9.

  • Valid values when PeriodType is set to Year: 1 to 3.

PeriodType

String

No

No

The unit of the subscription duration of the cluster.

This property must be specified only when PayType is set to Prepaid.

Valid values:

  • Year

  • Month

ResourceGroupId

String

No

Yes

The ID of the resource group.

None.

Tags

List

No

Yes

The tags.

You can add up to 20 tags.

For more information, see Tags properties.

ZoneId

String

No

No

The ID of the zone.

You can call the DescribeRegions operation to query zones.

Tags syntax

"Tags": [
  {
    "Key": String,
    "Value": String
  }
]  

Tags properties

Property

Type

Required

Editable

Description

Constraint

Key

String

Yes

No

The tag key.

The tag key must be 1 to 128 characters in length and cannot contain http:// or https://. The tag key cannot start with aliyun or acs:.

Value

String

No

No

The tag value.

The tag value can be up to 128 characters in length and cannot contain http:// or https://. The tag value cannot start with aliyun or acs:.

Return values

Fn::GetAtt

  • DBClusterId: the ID of the cluster.

  • OrderId: the ID of the order.

  • ConnectionString: the VPC endpoint.

  • Arn: the Alibaba Cloud Resource Name (ARN).

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  DBClusterCategory:
    Type: String
    Description: |-
      The edition of the cluster.
      Valid values when the cluster is in reserved mode:
      Basic
      Cluster
      When the cluster is in elastic mode, set the value to MixedStorage.
    AllowedValues:
      - Basic
      - Cluster
      - MixedStorage
    Default: MixedStorage
  ZoneId:
    AssociationProperty: ALIYUN::ECS::Instance:ZoneId
    Type: String
    Description: The zone ID of the cluster. You can call the DescribeRegions operation to query the most recent zone list.
  VPCId:
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
    Type: String
    Description: |-
      The ID of the VPC.
      Note If you leave this parameter empty, the default VPC or vSwitch of the specified region is used. If the region does not have a default VPC, a VPC is created.
  VSwitchId:
    AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
    Type: String
    Description: The ID of the vSwitch.
    AssociationPropertyMetadata:
      VpcId: VPC
      ZoneId: VSwitchZoneId
  Mode:
    Type: String
    Description: |-
      The mode of the cluster. Valid values:
      Reserver: the reserved mode
      Flexible: the elastic mode
    AllowedValues:
      - Reserver
      - Flexible
    Default: Flexible
  ComputeResource:
    Type: String
    Description: The computing resource of the cluster. This parameter is required in elastic mode.
    Default: 8Core32GB
  PayType:
    Type: String
    Description: |-
      The billing method of the cluster. Valid values:
      Postpaid: pay-as-you-go
      Prepaid: subscription
    AllowedValues:
      - Prepaid
      - PostPaid
    Default: PostPaid
  ElasticIOResource:
    Type: Number
    Description: |-
      Elastic IO Unit
      Note the flexible mode cluster will use this parameter.
    Default: 0
  DBClusterVersion:
    Type: String
    Description: The version of the cluster. Set the value to 3.0.
    Default: '3.0'
Resources:
  DBCluster:
    Type: ALIYUN::ADB::DBCluster
    Properties:
      DBClusterCategory:
        Ref: DBClusterCategory
      ZoneId:
        Ref: ZoneId
      VPCId:
        Ref: VPCId
      VSwitchId:
        Ref: VSwitchId
      Mode:
        Ref: Mode
      ComputeResource:
        Ref: ComputeResource
      PayType:
        Ref: PayType
      ElasticIOResource:
        Ref: ElasticIOResource
      DBClusterVersion:
        Ref: DBClusterVersion
Outputs:
  DBClusterId:
    Description: The ID of the cluster.
    Value:
      Fn::GetAtt:
        - DBCluster
        - DBClusterId
  OrderId:
    Description: The ID of the order.
    Value:
      Fn::GetAtt:
        - DBCluster
        - OrderId
  ConnectionString:
    Description: Vpc connection string.
    Value:
      Fn::GetAtt:
        - DBCluster
        - ConnectionString

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "DBClusterCategory": {
      "Type": "String",
      "Description": "The edition of the cluster.\nValid values when the cluster is in reserved mode:\nBasic\nCluster\nWhen the cluster is in elastic mode, set the value to MixedStorage.",
      "AllowedValues": [
        "Basic",
        "Cluster",
        "MixedStorage"
      ],
      "Default": "MixedStorage"
    },
    "ZoneId": {
      "AssociationProperty": "ALIYUN::ECS::Instance:ZoneId",
      "Type": "String",
      "Description": "The zone ID of the cluster. You can call the DescribeRegions operation to query the most recent zone list."
    },
    "VPCId": {
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
      "Type": "String",
      "Description": "The ID of the VPC.\nNote If you leave this parameter empty, the default VPC or vSwitch of the specified region is used. If the region does not have a default VPC, a VPC is created."
    },
    "VSwitchId": {
      "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
      "Type": "String",
      "Description": "The ID of the vSwitch.",
      "AssociationPropertyMetadata": {
        "VpcId": "VPC",
        "ZoneId": "VSwitchZoneId"
      }
    },
    "Mode": {
      "Type": "String",
      "Description": "The mode of the cluster. Valid values:\nReserver: the reserved mode\nFlexible: the elastic mode",
      "AllowedValues": [
        "Reserver",
        "Flexible"
      ],
      "Default": "Flexible"
    },
    "ComputeResource": {
      "Type": "String",
      "Description": "The computing resource of the cluster. This parameter is required in elastic mode.",
      "Default": "8Core32GB"
    },
    "PayType": {
      "Type": "String",
      "Description": "The billing method of the cluster. Valid values:\nPostpaid: pay-as-you-go\nPrepaid: subscription",
      "AllowedValues": [
        "Prepaid",
        "PostPaid"
      ],
      "Default": "PostPaid"
    },
    "ElasticIOResource": {
      "Type": "Number",
      "Description": "Elastic IO Unit\nNote the flexible mode cluster will use this parameter.",
      "Default": 0
    },
    "DBClusterVersion": {
      "Type": "String",
      "Description": "The version of the cluster. Set the value to 3.0.",
      "Default": "3.0"
    }
  },
  "Resources": {
    "DBCluster": {
      "Type": "ALIYUN::ADB::DBCluster",
      "Properties": {
        "DBClusterCategory": {
          "Ref": "DBClusterCategory"
        },
        "ZoneId": {
          "Ref": "ZoneId"
        },
        "VPCId": {
          "Ref": "VPCId"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        },
        "Mode": {
          "Ref": "Mode"
        },
        "ComputeResource": {
          "Ref": "ComputeResource"
        },
        "PayType": {
          "Ref": "PayType"
        },
        "ElasticIOResource": {
          "Ref": "ElasticIOResource"
        },
        "DBClusterVersion": {
          "Ref": "DBClusterVersion"
        }
      }
    }
  },
  "Outputs": {
    "DBClusterId": {
      "Description": "The ID of the cluster.",
      "Value": {
        "Fn::GetAtt": [
          "DBCluster",
          "DBClusterId"
        ]
      }
    },
    "OrderId": {
      "Description": "The ID of the order.",
      "Value": {
        "Fn::GetAtt": [
          "DBCluster",
          "OrderId"
        ]
      }
    },
    "ConnectionString": {
      "Description": "Vpc connection string.",
      "Value": {
        "Fn::GetAtt": [
          "DBCluster",
          "ConnectionString"
        ]
      }
    }
  }
}