ALIYUN::POLARDB::DBCluster类型用于创建POLARDB集群。

语法

{
  "Type": "ALIYUN::POLARDB::DBCluster",
  "Properties": {
    "VpcId": String,
    "DBClusterDescription": String,
    "DBType": String,
    "ClusterNetworkType": String,
    "RenewalStatus": String,
    "AutoRenewPeriod": Integer,
    "Period": Integer,
    "ZoneId": String,
    "SourceResourceId": String,
    "MaintainTime": String,
    "DBVersion": String,
    "CreationOption": String,
    "DBNodeClass": String,
    "VSwitchId": String,
    "CloneDataPoint": String,
    "PayType": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
VpcId String 专有网络ID。 无。
DBClusterDescription String 集群名称。 长度为2~256个字符。以中文、英文字母开头,可以包含中文、英文字符、数字、”,”、” -”,不能以http://或https开头。
DBType String 数据库类型。 取值:MySQL、PostgreSQL、Oracle。
ClusterNetworkType String 网络类型。 取值:VPC。默认值:VPC。
RenewalStatus String 自动续费状态。 取值:AutoRenewal(自动续费)、Normal(手动续费)、NotRenewal(不再续费)。默认值:Normal。设置为NotRenewal后,系统不再发送到期提醒,只在到期前第三天发送不续费提醒。
AutoRenewPeriod Integer 设置实例自动续费时长。 单位:月。取值:1、2、3、6、12、24、36。默认值:1。
Period Integer 预付费类型(即PayType为Prepaid时)实例的自动续费时长。 单位:月。取值:1、2、3、4、5、6、7、8、9、12、24、36。
ZoneId String 可用区ID。 可通过函数DescribeRegions查看。
SourceResourceId String 源RDS实例ID或源POLARDB集群ID。 当DBType=MySQL且DBVersion=5.6时,此参数有意义。如果CreationOption值不等于Normal,此参数必填。
MaintainTime String 集群的可维护时间。 格式:HH:mmZ-HH:mmZ。例如16:00Z-17:00Z,表示0点到1点(UTC+08:00)可进行例行维护。
DBVersion String 数据库版本号。 根据DBType进行取值:
  • MySQL:5.6、8.0
  • PostgreSQL:11
  • Oracle:11
CreationOption String 创建方式。 详情请参见CreateDBCluster。取值:Normal(创建一个全新的POLARDB集群)、CloneFromPolarDB(从现有POLARDB集群克隆数据到新的POLARDB集群)、CloneFromRDS(从现有RDS实例克隆数据到新的POLARDB集群)、MigrationFromRDS(从现有RDS实例迁移数据到新的POLARDB集群)。 默认值:Normal。当DBType=MySQL且DBVersion=5.6时,此参数的取值为CloneFromRDS或MigrationFromRDS。
DBNodeClass String 节点规格。 详情请参见规格与定价
VSwitchId String 虚拟交换机ID。 无。
CloneDataPoint String 克隆数据的时间节点。 取值:LATEST(最新时间点的数据)、<BackupID>(历史备份集ID)、<Timestamp>(历史时间点,格式:yyyy-MM-ddTHH:mm:ssZ,UTC时间)。默认值:LATEST。当DBType=MySQL且DBVersion=5.6,并且CreationOption=CloneFromRDS或CloneFromPolarDB时,此参数有意义。如果CreationOption=CloneFromRDS,此参数的取值为LATEST。
PayType String 付费类型。 取值:Postpaid(按量付费)、Prepaid(预付费,包年包月)。

返回值

Fn::GetAtt

  • DBClusterId:集群ID。
  • OrderId:订单ID。
  • DBNodeIds:集群节点ID。
  • PrimaryEndpointId:主地址ID。
  • CustomEndpointIds:自定义集群地址ID。
  • CustomConnectionStrings:自定义连接串。
  • PrimaryConnectionString:主连接串。
  • ClusterConnectionString:自定义连接串。
  • ClusterEndpointId:集群地址ID。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "DBCluster": {
      "Type": "ALIYUN::POLARDB::DBCluster",
      "Properties": {
        "MaintainTime": {
          "Ref": "MaintainTime"
        },
        "VpcId": {
          "Ref": "VpcId"
        },
        "CreationOption": {
          "Ref": "CreationOption"
        },
        "DBType": {
          "Ref": "DBType"
        },
        "ClusterNetworkType": {
          "Ref": "ClusterNetworkType"
        },
        "RenewalStatus": {
          "Ref": "RenewalStatus"
        },
        "AutoRenewPeriod": {
          "Ref": "AutoRenewPeriod"
        },
        "Period": {
          "Ref": "Period"
        },
        "ZoneId": {
          "Ref": "ZoneId"
        },
        "SourceResourceId": {
          "Ref": "SourceResourceId"
        },
        "VSwitchId": {
          "Ref": "VSwitchId"
        },
        "DBVersion": {
          "Ref": "DBVersion"
        },
        "DBClusterDescription": {
          "Ref": "DBClusterDescription"
        },
        "DBNodeClass": {
          "Ref": "DBNodeClass"
        },
        "CloneDataPoint": {
          "Ref": "CloneDataPoint"
        },
        "PayType": {
          "Ref": "PayType"
        }
      }
    }
  },
  "Parameters": {
    "MaintainTime": {
      "Type": "String",
      "Description": "The maintainable time of the cluster:\nFormat: HH: mmZ- HH: mmZ.\nExample: 16:00Z-17:00Z, which means 0 to 1 (UTC+08:00) for routine maintenance."
    },
    "VpcId": {
      "Type": "String",
      "Description": "The ID of the VPC to connect to."
    },
    "CreationOption": {
      "Default": "Normal",
      "Type": "String",
      "Description": "The method for creating an ApsaraDB for POLARDB cluster. Valid values:\nNormal: creates an ApsaraDB for POLARDB cluster.\nCloneFromPolarDB: clones data from an existing ApsaraDB for POLARDB cluster to a new\nApsaraDB for POLARDB cluster.\nCloneFromRDS: clones data from an existing ApsaraDB for RDS instance to a new ApsaraDB\nfor POLARDB cluster.\nMigrationFromRDS: migrates data from an existing ApsaraDB for RDS instance to a new\nApsaraDB for POLARDB cluster. The created ApsaraDB for POLARDB cluster is in read-only\nmode and has binary logs enabled by default.\nDefault value: Normal.\nNote This parameter takes effect only when the DBType parameter is set to MySQL and the DBVersion parameter is set to 5.6.",
      "AllowedValues": [
        "CloneFromPolarDB",
        "CloneFromRDS",
        "MigrationFromRDS",
        "Normal"
      ]
    },
    "DBType": {
      "Type": "String",
      "Description": "Database type, value:\nMySQL\nPostgreSQL\nOracle",
      "AllowedValues": [
        "MySQL",
        "Oracle",
        "PostgreSQL"
      ]
    },
    "ClusterNetworkType": {
      "Default": "VPC",
      "Type": "String",
      "Description": "The network type of the cluster. Currently, only VPC is supported. Default value: VPC.",
      "AllowedValues": [
        "VPC"
      ]
    },
    "RenewalStatus": {
      "Default": "Normal",
      "Type": "String",
      "Description": "The auto renewal status of the cluster Valid values:\nAutoRenewal: automatically renews the cluster.\nNormal: manually renews the cluster.\nNotRenewal: does not renew the cluster.\nDefault value: Normal.\nNote If this parameter is set to NotRenewal, the system does not send a reminder for expiration,\nbut only sends an SMS message three days before the cluster expires to remind you\nthat the cluster is not renewed.",
      "AllowedValues": [
        "AutoRenewal",
        "Normal",
        "NotRenewal"
      ]
    },
    "AutoRenewPeriod": {
      "Default": 1,
      "Type": "Number",
      "Description": "Set the cluster auto renewal time. Valid values: 1, 2, 3, 6, 12, 24, 36. Default to 1.",
      "AllowedValues": [
        1,
        2,
        3,
        6,
        12,
        24,
        36
      ]
    },
    "Period": {
      "Type": "Number",
      "Description": "The subscription period of the cluster in month. Valid values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36.",
      "AllowedValues": [
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        12,
        24,
        36
      ]
    },
    "ZoneId": {
      "Type": "String",
      "Description": "The zone ID of the cluster. You can call the DescribeRegions operation to query available zones."
    },
    "SourceResourceId": {
      "Type": "String",
      "Description": "The ID of the source RDS instance or source POLARDB cluster.\nNote\nThis parameter takes effect only when the DBType parameter is set to MySQL and the DBVersion parameter is set to 5.6.\nThis parameter is required if the CreationOption parameter is not set to Normal."
    },
    "VSwitchId": {
      "Type": "String",
      "Description": "The ID of the VSwitch to connect to."
    },
    "DBVersion": {
      "Type": "String",
      "Description": "The version of the database. Valid values:\nMySQL: 5.6 or 8.0\nPostgreSQL: 11\nOracle: 11",
      "AllowedValues": [
        "5.6",
        "8.0",
        "11"
      ]
    },
    "DBClusterDescription": {
      "MinLength": 2,
      "Type": "String",
      "Description": "The description of the cluster. The description must comply with the following rules:\nIt must start with a Chinese character or an English letter.\nIt can contain Chinese and English characters, digits, underscores (_), and hyphens (-).\nIt cannot start with http:// or https://.\nIt must be 2 to 256 characters in length.",
      "MaxLength": 256
    },
    "DBNodeClass": {
      "Type": "String",
      "Description": "The node specifications of the cluster. For more information, see Specifications and pricing."
    },
    "CloneDataPoint": {
      "Default": "LATEST",
      "Type": "String",
      "Description": "The time point of data to be cloned. Valid values:\nLATEST: clones data of the latest time point.\n<BackupID>: clones historical backup data. Specify the ID of the specific backup set.\n<Timestamp>: clones data of a historical time point. Specify the specific time in\nthe yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.\nDefault value: LATEST.\nNote\nThis parameter takes effect only when the DBType parameter is set to MySQL, the DBVersion parameter is set to 5.6, and the CreationOption parameter is set to CloneFromRDS or CloneFromPolarDB.\nIf the CreationOption parameter is set to CloneFromRDS, the value of this parameter must be LATEST."
    },
    "PayType": {
      "Type": "String",
      "Description": "The billing method of the cluster. Valid values:\nPostpaid: pay-as-you-go\nPrepaid: subscription",
      "AllowedValues": [
        "Postpaid",
        "Prepaid"
      ]
    }
  },
  "Outputs": {
    "DBClusterId": {
      "Description": "The ID of the ApsaraDB for POLARDB cluster.",
      "Value": {
        "Fn::GetAtt": [
          "DBCluster",
          "DBClusterId"
        ]
      }
    },
    "OrderId": {
      "Description": "The Order ID.",
      "Value": {
        "Fn::GetAtt": [
          "DBCluster",
          "OrderId"
        ]
      }
    },
    "DBNodeIds": {
      "Description": "The ID list of cluster nodes.",
      "Value": {
        "Fn::GetAtt": [
          "DBCluster",
          "DBNodeIds"
        ]
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  DBCluster:
    Type: ALIYUN::POLARDB::DBCluster
    Properties:
      MaintainTime:
        Ref: MaintainTime
      VpcId:
        Ref: VpcId
      CreationOption:
        Ref: CreationOption
      DBType:
        Ref: DBType
      ClusterNetworkType:
        Ref: ClusterNetworkType
      RenewalStatus:
        Ref: RenewalStatus
      AutoRenewPeriod:
        Ref: AutoRenewPeriod
      Period:
        Ref: Period
      ZoneId:
        Ref: ZoneId
      SourceResourceId:
        Ref: SourceResourceId
      VSwitchId:
        Ref: VSwitchId
      DBVersion:
        Ref: DBVersion
      DBClusterDescription:
        Ref: DBClusterDescription
      DBNodeClass:
        Ref: DBNodeClass
      CloneDataPoint:
        Ref: CloneDataPoint
      PayType:
        Ref: PayType
Parameters:
  MaintainTime:
    Type: String
    Description: |-
      The maintainable time of the cluster:
      Format: HH: mmZ- HH: mmZ.
      Example: 16:00Z-17:00Z, which means 0 to 1 (UTC+08:00) for routine maintenance.
  VpcId:
    Type: String
    Description: The ID of the VPC to connect to.
  CreationOption:
    Default: Normal
    Type: String
    Description: |-
      The method for creating an ApsaraDB for POLARDB cluster. Valid values:
      Normal: creates an ApsaraDB for POLARDB cluster.
      CloneFromPolarDB: clones data from an existing ApsaraDB for POLARDB cluster to a new
      ApsaraDB for POLARDB cluster.
      CloneFromRDS: clones data from an existing ApsaraDB for RDS instance to a new ApsaraDB
      for POLARDB cluster.
      MigrationFromRDS: migrates data from an existing ApsaraDB for RDS instance to a new
      ApsaraDB for POLARDB cluster. The created ApsaraDB for POLARDB cluster is in read-only
      mode and has binary logs enabled by default.
      Default value: Normal.
      Note This parameter takes effect only when the DBType parameter is set to MySQL and the DBVersion parameter is set to 5.6.
    AllowedValues:
    - CloneFromPolarDB
    - CloneFromRDS
    - MigrationFromRDS
    - Normal
  DBType:
    Type: String
    Description: |-
      Database type, value:
      MySQL
      PostgreSQL
      Oracle
    AllowedValues:
    - MySQL
    - Oracle
    - PostgreSQL
  ClusterNetworkType:
    Default: VPC
    Type: String
    Description: 'The network type of the cluster. Currently, only VPC is supported.
      Default value: VPC.'
    AllowedValues:
    - VPC
  RenewalStatus:
    Default: Normal
    Type: String
    Description: |-
      The auto renewal status of the cluster Valid values:
      AutoRenewal: automatically renews the cluster.
      Normal: manually renews the cluster.
      NotRenewal: does not renew the cluster.
      Default value: Normal.
      Note If this parameter is set to NotRenewal, the system does not send a reminder for expiration,
      but only sends an SMS message three days before the cluster expires to remind you
      that the cluster is not renewed.
    AllowedValues:
    - AutoRenewal
    - Normal
    - NotRenewal
  AutoRenewPeriod:
    Default: 1
    Type: Number
    Description: 'Set the cluster auto renewal time. Valid values: 1, 2, 3, 6, 12,
      24, 36. Default to 1.'
    AllowedValues:
    - 1
    - 2
    - 3
    - 6
    - 12
    - 24
    - 36
  Period:
    Type: Number
    Description: 'The subscription period of the cluster in month. Valid values: 1,
      2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36.'
    AllowedValues:
    - 1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
    - 8
    - 9
    - 12
    - 24
    - 36
  ZoneId:
    Type: String
    Description: The zone ID of the cluster. You can call the DescribeRegions operation
      to query available zones.
  SourceResourceId:
    Type: String
    Description: |-
      The ID of the source RDS instance or source POLARDB cluster.
      Note
      This parameter takes effect only when the DBType parameter is set to MySQL and the DBVersion parameter is set to 5.6.
      This parameter is required if the CreationOption parameter is not set to Normal.
  VSwitchId:
    Type: String
    Description: The ID of the VSwitch to connect to.
  DBVersion:
    Type: String
    Description: |-
      The version of the database. Valid values:
      MySQL: 5.6 or 8.0
      PostgreSQL: 11
      Oracle: 11
    AllowedValues:
    - '5.6'
    - '8.0'
    - '11'
  DBClusterDescription:
    MinLength: 2
    Type: String
    Description: |-
      The description of the cluster. The description must comply with the following rules:
      It must start with a Chinese character or an English letter.
      It can contain Chinese and English characters, digits, underscores (_), and hyphens (-).
      It cannot start with http:// or https://.
      It must be 2 to 256 characters in length.
    MaxLength: 256
  DBNodeClass:
    Type: String
    Description: The node specifications of the cluster. For more information, see
      Specifications and pricing.
  CloneDataPoint:
    Default: LATEST
    Type: String
    Description: |-
      The time point of data to be cloned. Valid values:
      LATEST: clones data of the latest time point.
      <BackupID>: clones historical backup data. Specify the ID of the specific backup set.
      <Timestamp>: clones data of a historical time point. Specify the specific time in
      the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.
      Default value: LATEST.
      Note
      This parameter takes effect only when the DBType parameter is set to MySQL, the DBVersion parameter is set to 5.6, and the CreationOption parameter is set to CloneFromRDS or CloneFromPolarDB.
      If the CreationOption parameter is set to CloneFromRDS, the value of this parameter must be LATEST.
  PayType:
    Type: String
    Description: |-
      The billing method of the cluster. Valid values:
      Postpaid: pay-as-you-go
      Prepaid: subscription
    AllowedValues:
    - Postpaid
    - Prepaid
Outputs:
  DBClusterId:
    Description: The ID of the ApsaraDB for POLARDB cluster.
    Value:
      Fn::GetAtt:
      - DBCluster
      - DBClusterId
  OrderId:
    Description: The Order ID.
    Value:
      Fn::GetAtt:
      - DBCluster
      - OrderId
  DBNodeIds:
    Description: The ID list of cluster nodes.
    Value:
      Fn::GetAtt:
      - DBCluster
      - DBNodeIds