ALIYUN::ADB::DBCluster類型用於建立一個AnalyticDB MySQL版叢集。
文法
{
"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
}
}
屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
DBClusterCategory | String | 是 | 是 | 系列。 | 取值:
更多資訊,請參見產品系列。 |
DBClusterVersion | String | 是 | 否 | AnalyticDB MySQL叢集版本。 | 取值:3.0。 |
Mode | String | 是 | 否 | 模式。 | 取值:
|
PayType | String | 是 | 否 | 付費類型。 | 取值:
|
VPCId | String | 是 | 否 | 專用網路ID。 | 無 |
VSwitchId | String | 是 | 否 | 交換器ID。 | 無 |
ComputeResource | String | 否 | 是 | 計算資源。 | 計算資源。 Mode取值為Flexible(即彈性模式)時,本參數必填。 說明 您可以調用DescribeAvailableResource 介面查詢指定地區中可用的計算資源。 |
DBClusterClass | String | 否 | 是 | 規格。 | 叢集規格。取值:
說明 Mode取值為Reserver(即預留模式)時,本參數必填。 |
DBClusterDescription | String | 否 | 否 | 備忘資訊。 | 無 |
DBNodeGroupCount | Integer | 否 | 是 | 節點群組數量。 | 取值範圍為:1~200(整數)。 說明 Mode取值為Reserver(即預留模式)時,本參數必填。 |
DBNodeStorage | Integer | 否 | 是 | 節點儲存空間。 | 僅當Mode取值為Reserver時,該屬性必選。 單位:GB。 取值:
說明 1000 GB以下步長為100 GB,1000 GB以上步長為1000 GB。 |
ElasticIOResource | Integer | 否 | 是 | 彈性IO資源(Elastic IO Unit,簡稱EIU)。 | 僅當Mode取值為Flexible時,該屬性必選。 更多資訊,請參見彈性IO資源(EIU)擴容。 |
ExecutorCount | Integer | 否 | 否 | 彈性模式下叢集使用的計算節點數量。 | 無 |
Period | Integer | 否 | 否 | 訂用帳戶時間長度。 | 僅當PayType取值為Prepaid時,該屬性必選。 取值:
|
PeriodType | String | 否 | 否 | 指定預付費叢集為包年或包月類型。 | 僅當PayType取值為Prepaid時,該屬性必選。 取值:
|
ResourceGroupId | String | 否 | 是 | 資源群組ID。 | 無 |
Tags | List | 否 | 是 | 標籤。 | 最多添加20個標籤。 更多資訊,請參見Tags屬性。 |
ZoneId | String | 否 | 否 | 可用性區域ID。 | 通過調用DescribeRegions查詢可用性區域列表。 |
Tags文法
"Tags": [
{
"Key": String,
"Value": String
}
]
Tags屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
Key | String | 是 | 否 | 標籤鍵。 | 長度為1~128個字元,不能以 |
Value | String | 否 | 否 | 標籤值。 | 長度為0~128個字元,不能以 |
傳回值
Fn::GetAtt
DBClusterId:叢集ID。
OrderId:訂單ID。
ConnectionString:VPC連接字串。
樣本
YAML格式
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格式
{
"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"
]
}
}
}
}