全部產品
Search
文件中心

Resource Orchestration Service:ALIYUN::ADB::DBCluster

更新時間:Jun 19, 2024

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

系列。

取值:

  • Cluster:預留模式叢集版。

    說明

    僅中國內地地區和新加坡地區支援購買預留模式叢集版。其中,新加坡地區僅支援在隨用隨付模式下購買預留模式叢集版。

  • MixedStorage:彈性模式叢集版(新版)。

    說明

    當DBClusterCategory為Cluster時,Mode參數必須填寫Reserver;當DBClusterCategory為MixedStorage時,Mode參數必須填寫Flexible,否則會導致建立叢集失敗。

更多資訊,請參見產品系列

DBClusterVersion

String

AnalyticDB MySQL叢集版本。

取值:3.0。

Mode

String

模式。

取值:

  • Reserver:預留模式。

  • Flexible:彈性模式。

    說明

    本參數不填寫時,預設為預留模式。

PayType

String

付費類型。

取值:

  • Postpaid:隨用隨付。

  • Prepaid:預付費(訂用帳戶)。

VPCId

String

專用網路ID。

VSwitchId

String

交換器ID。

ComputeResource

String

計算資源。

計算資源。

Mode取值為Flexible(即彈性模式)時,本參數必填。

說明

您可以調用DescribeAvailableResource 介面查詢指定地區中可用的計算資源。

DBClusterClass

String

規格。

叢集規格。取值:

  • C8

  • C32

說明

Mode取值為Reserver(即預留模式)時,本參數必填。

DBClusterDescription

String

備忘資訊。

DBNodeGroupCount

Integer

節點群組數量。

取值範圍為:1~200(整數)。

說明

Mode取值為Reserver(即預留模式)時,本參數必填。

DBNodeStorage

Integer

節點儲存空間。

僅當Mode取值為Reserver時,該屬性必選。

單位:GB。

取值:

  • 規格為C8時,取值範圍為:100~1000。

  • 規格為C32時,取值範圍為:100~8000。

說明

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時,該屬性必選。

取值:

  • 包月時:1~9。

  • 包年時:1~3。

PeriodType

String

指定預付費叢集為包年或包月類型。

僅當PayType取值為Prepaid時,該屬性必選。

取值:

  • Year:包年。

  • Month:包月。

ResourceGroupId

String

資源群組ID。

Tags

List

標籤。

最多添加20個標籤。

更多資訊,請參見Tags屬性

ZoneId

String

可用性區域ID。

通過調用DescribeRegions查詢可用性區域列表。

Tags文法

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

Tags屬性

屬性名稱

類型

必須

允許更新

描述

約束

Key

String

標籤鍵。

長度為1~128個字元,不能以aliyunacs:開頭,不能包含http://https://

Value

String

標籤值。

長度為0~128個字元,不能以aliyunacs:開頭,不能包含http://https://

傳回值

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