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

属性

属性名称 类型 必须 允许更新 描述 约束
DBNodeStorage Integer 节点存储空间。

仅当Mode取值为Reserver时,该属性必选。

取值:

  • 当DBClusterClass取值为T8时:100 GB~500 GB
  • 当DBClusterClass取值为T16时:100 GB~2000 GB
  • 当DBClusterClass取值为T32时:100 GB~2000 GB
  • 当DBClusterClass取值为T52时:100 GB~4000 GB
  • 当DBClusterClass取值为C8时:100 GB~1000 GB
  • 当DBClusterClass取值为C32时:100 GB~8000 GB
说明 1000 GB以下步长为100 GB,1000 GB以上步长为1000 GB。
PeriodType String 指定预付费集群为包年或包月类型。

仅当PayType取值为Prepaid时,该属性必选。

取值:

  • Year:包年
  • Month:包月
DBClusterCategory String 系列。

取值:

  • 当Mode取值为Reserver时:
    • Basic:基础版
    • Cluster:集群版
  • 当Mode取值为Flexible时:

    MixedStorage:集群版(新版)

更多信息,请参见产品系列

ZoneId String 可用区ID。 通过调用DescribeRegions查询可用区列表。
ResourceGroupId String 资源组ID。
VPCId String 专有网络ID。
VSwitchId String 交换机ID。
Mode String 模式。 取值:
  • Reserver:预留模式
  • Flexible:弹性模式
DBClusterDescription String 备注信息。
ComputeResource String 计算资源。 仅当Mode取值为Flexible时,该属性必选。
Period Integer 包年包月时长。

仅当PayType取值为Prepaid时,该属性必选。

取值:

  • 包月时:1~9
  • 包年时:1~3
PayType String 付费类型。 取值:
  • Postpaid:按量付费
  • Prepaid:预付费(包年包月)
ElasticIOResource Integer 弹性IO资源(Elastic IO Unit,简称EIU)。 仅当Mode取值为Flexible时,该属性必选。

更多信息,请参见EIU详解

DBClusterVersion String AnalyticDB MySQL集群版本。 取值:3.0
DBNodeGroupCount Integer 节点组数量。

仅当Mode取值为Reserver时,该属性必选。

取值:

  • 当DBClusterClass取值为T8时:1
  • 当DBClusterClass取值为T16时:1
  • 当DBClusterClass取值为T32时:1
  • 当DBClusterClass取值为T52时:1
  • 当DBClusterClass取值为C8时:1~128
  • 当DBClusterClass取值为C32时:1~128
ExecutorCount Integer 弹性模式下集群使用的计算节点数量。
DBClusterClass String 规格。

仅当Mode取值为Reserver时,该属性必选。

取值:

  • 基础版
    • T8
    • T16
    • T32
    • T52
  • 集群版
    • C8
    • C32

返回值

Fn::GetAtt

  • DBClusterId:集群ID。
  • OrderId:订单ID。
  • ConnectionString:VPC连接字符串。

示例

{
  "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": [
        "Subscription",
        "PrePaid",
        "PrePay",
        "Prepaid",
        "PayAsYouGo",
        "PostPaid",
        "PayOnDemand",
        "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"
        ]
      }
    }
  }
}