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"
]
}
}
}
}