Use the ALIYUN::ADB::DBCluster resource type 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,
"KmsId": String,
"DiskEncryption": Boolean,
"EnableSSL": Boolean,
"Tags": List
}
}Properties
Property name | Type | Required | Update allowed | Description | Constraint |
DBClusterCategory | String | Yes | Yes | Series | Valid values:
For more information, see Editions. |
DBClusterVersion | String | Yes | No | Version of the AnalyticDB for MySQL cluster. | Set the value to 3.0. |
Mode | String | Yes | No | pattern. | Valid values:
|
PayType | String | Yes | No | Billing method. | Valid values:
|
VPCId | String | Yes | No | ID of the virtual private cloud (VPC). | None. |
VSwitchId | String | Yes | No | ID of the vSwitch. | None. |
ComputeResource | String | No | Yes | Computing resource. | Computing resource. This parameter is required if Mode is Flexible (elastic mode). Note Call the DescribeAvailableResource operation to query available computing resources in a specified region. |
DBClusterClass | String | No | Yes | Specification. | Cluster specification. Valid values:
Note This parameter is required if Mode is Reserver (reserved mode). |
DBClusterDescription | String | No | No | Note | None. |
DBNodeGroupCount | Integer | No | Yes | Number of node groups. | Valid values: 1 to 200 (integer). Note This parameter is required if Mode is Reserver (reserved mode). |
DBNodeStorage | Integer | No | Yes | Storage capacity per node. | This property is required only if Mode is Reserver. Unit: GB. Valid values:
Note Step size: 100 GB for values less than 1000 GB. Step size: 1000 GB for values greater than or equal to 1000 GB. |
ElasticIOResource | Integer | No | Yes | Elastic I/O unit (EIU). | This property is required only if Mode is Flexible. For more information, see Scale out elastic I/O units (EIUs). |
ExecutorCount | Integer | No | No | Number of compute nodes used by the cluster in elastic mode. | None. |
KmsId | String | No | No | ID of the key used to encrypt disk data. | Note This parameter applies only when disk encryption is enabled for the AnalyticDB for MySQL cluster. |
DiskEncryption | Boolean | No | No | Specifies whether to enable disk encryption. | None. |
EnableSSL | Boolean | No | No | Specifies whether to enable SSL encryption for connections. | Valid values:
|
Period | Integer | No | No | Subscription duration. | This property is required only if PayType is Prepaid. Valid values:
|
PeriodType | String | No | No | Specifies whether the subscription cluster is billed monthly or yearly. | This property is required only if PayType is Prepaid. Valid values:
|
ResourceGroupId | String | No | Yes | ID of the resource group. | None. |
Tags | List | No | Yes | Tags. | You can add up to 20 tags. For more information, see Tags property. |
ZoneId | String | No | No | ID of the zone. | Call DescribeRegions to query available zones. |
Tags syntax
"Tags": [
{
"Key": String,
"Value": String
}
]Tags property
Property name | Type | Required | Update allowed | Description | Constraint |
Key | String | Yes | No | Tag key. | Length: 1 to 128 characters. Cannot start with |
Value | String | No | No | Tag value. | Length: 0 to 128 characters. Cannot start with |
Return values
Fn::GetAtt
DBClusterId: The ID of the cluster.
OrderId: The ID of the order.
ConnectionString: The connection string for the VPC.
Arn: The Alibaba Cloud Resource Name (ARN) of the resource.
Examples
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{
"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"
]
}
}
}
}