文档

ALIYUN::POLARDB::DBCluster

更新时间:

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,
    "SecurityGroupIds": List,
    "Tags": List,
    "SourceResourceId": String,
    "MaintainTime": String,
    "DBVersion": String,
    "CreationOption": String,
    "DBNodeClass": String,
    "VSwitchId": String,
    "SecurityIPList": String,
    "CloneDataPoint": String,
    "PayType": String,
    "CreationCategory": String,
    "BackupRetentionPolicyOnClusterDeletion": String,
    "ResourceGroupId": String,
    "DefaultTimeZone": String,
    "GDNId": String,
    "LowerCaseTableNames": Integer,
    "DBClusterParameters": Map,
    "TDEStatus": Boolean,
    "PeriodUnit": String,
    "ScaleRoNumMin": Integer,
    "ScaleMax": Integer,
    "AllowShutDown": Boolean,
    "ServerlessType": String,
    "ScaleRoNumMax": Integer,
    "ScaleMin": Integer,
    "StorageType": String,
    "LooseXEngine": String,
    "LoosePolarLogBin": String,
    "StorageSpace": Integer,
    "ProxyType": String,
    "StandbyAZ": String,
    "LooseXEngineUseMemoryPct": Integer,
    "StorageUpperBound": Integer,
    "StrictConsistency": String,
    "StoragePayType": String,
    "DBNodeNum": Integer,
    "ProxyClass": String,
    "HotStandbyCluster": String,
    "StorageAutoScale": String,
    "Architecture": String,
    "DBMinorVersion": String,
    "ParameterGroupId": String,
    "RestartMasterNode": Boolean,
    "ColdStorageOption": Map
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

VpcId

String

专有网络ID。

DBClusterDescription

String

集群描述。

长度为2~256个字符。以英文字母或汉字开头,不能以http://https://开头。可包含英文字母、汉字、数字、半角逗号(,)和短划线(-) 。

DBType

String

数据库引擎类型。

取值:

  • MySQL

  • PostgreSQL

  • Oracle

ClusterNetworkType

String

集群网络类型。

当前仅支持专有网络,取值:VPC。

RenewalStatus

String

自动续费状态。

取值:

  • AutoRenewal:自动续费。

  • Normal(默认值):手动续费。

  • NotRenewal:不再续费。

    说明

    设置为NotRenewal后,系统不再发送到期提醒,只在到期前第三天发送不续费提醒。

AutoRenewPeriod

Integer

实例自动续费时长。

取值:

  • 1(默认值)

  • 2

  • 3

  • 6

  • 12

  • 24

  • 36

单位:月。

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,该参数必填。

SecurityGroupIds

List

安全组ID列表。

最多支持3个安全组。

Tags

List

标签。

最多支持添加20个标签。

更多信息,请参见Tags属性

MaintainTime

String

集群的可维护时间。

格式:HH:mmZ-HH:mmZ。例如:16:00Z-17:00Z,表示0点到1点(UTC+08:00)可进行例行维护。

DBVersion

String

数据库版本号。

取值:

  • 当DBType取值为MySQL时:5.6、8.0。

  • 当DBType取值为PostgreSQL时:11。

  • 当DBType取值为Oracle时:11。

CreationOption

String

创建方式。

取值:

  • Normal(默认值):创建一个全新的PolarDB集群。

  • CloneFromPolarDB:从现有PolarDB集群克隆数据到新的PolarDB集群。

  • CloneFromRDS:从现有RDS实例克隆数据到新的PolarDB集群。

  • MigrationFromRDS:从现有RDS实例迁移数据到新的PolarDB集群。

当DBType取值为MySQL且DBVersion取值为5.6时,该参数取值为CloneFromRDS或MigrationFromRDS。

DBNodeClass

String

节点规格。

更多信息,请参见计费项概览

VSwitchId

String

交换机ID。

SecurityIPList

String

PolarDB集群白名单。

CloneDataPoint

String

克隆数据的时间节点。

取值:

  • LATEST(默认值):最新时间点的数据。

    说明

    当CreationOption取值为CloneFromRDS时,该参数取值为LATEST。

  • BackupID:历史备份集ID。

  • Timestamp:历史时间点,格式:yyyy-MM-ddTHH:mm:ssZ(UTC时间)。

当DBType取值为MySQL且DBVersion取值为5.6,并且CreationOption取值为CloneFromRDS或CloneFromPolarDB时,该参数有效。

PayType

String

付费类型。

取值:

  • Postpaid:按量付费。

  • Prepaid:预付费(包年包月)。

CreationCategory

String

集群系列。

取值:Normal(标准版)。

BackupRetentionPolicyOnClusterDeletion

String

删除集群时备份集保留策略。

取值:

  • ALL:永久保留全部备份。

  • LATEST:永久保留最后一个备份(删除前自动备份)。

  • NONE(默认值):集群删除时不保留备份集。

说明

仅当DBType取值为MySQL时,该参数生效。

ResourceGroupId

String

资源组ID。

DefaultTimeZone

String

集群时区(UTC)。

默认取值为SYSTEM,默认时区与Region所在时区一致。

可选取值范围为-12:00~+13:00内的所有整数时间点,如 00:00。

说明

仅当DBType取值为MySQL时,该参数生效。

GDNId

String

全球数据库网络ID。

当CreationOption取值为CreateGdnStandby时,该参数必填。

LowerCaseTableNames

Integer

表名是否区分大小写。

取值:

  • 1(默认值):不区分大小写。

  • 0:区分大小写。

说明

仅当DBType为MySQL时,该参数生效。

DBClusterParameters

Map

PolarDB集群的参数。

更多信息,请参见DBClusterParameters属性

TDEStatus

Boolean

是否开启透明数据加密(TDE)。

取值:

  • true:开启。

    说明

    TDE功能开启后不可关闭。

  • false(默认值):关闭。

说明

当DBType取值为PostgreSQL或DBType取值为Oracle时,该参数生效。

PeriodUnit

String

时长单位。

取值:

  • Year:年。

  • Month:月。

ScaleRoNumMin

Integer

只读节点数的最小扩容和缩容限制。

ScaleMax

Integer

单节点扩容和缩容的最大限制。

AllowShutDown

Boolean

是否开启无活动暂停。

取值:

  • true:开启无活动暂停。

  • false:关闭无活动暂停。

ServerlessType

String

Serverless服务类型。

取值:AgileServerless。

ScaleRoNumMax

Integer

只读节点数的最大扩容和缩容限制。

ScaleMin

Integer

单节点扩容和缩容的最小限制。

StorageType

String

存储类型。

企业版存储类型取值如下:

  • PSL5

  • PSL4

标准版存储类型取值如下:

  • ESSDPL1

  • ESSDPL2

  • ESSDPL3

说明

Serverless集群不支持该参数。

LooseXEngine

String

开启X-Engine存储引擎功能。

取值:

  • ON:集群开启X-Engine引擎

  • OFF:集群关闭X-Engine引擎

说明

当参数CreationOption不等于CreateGdnStandbyDBTypeMySQLDBVersion8.0时,该参数才生效。开启X-Engine引擎的节点内存规格必须大于等于16 GB。

LoosePolarLogBin

String

开启Binlog功能。

取值:

  • ON:集群开启Binlog功能

  • OFF:集群关闭Binlog功能

说明

当参数DBTypeMySQL时,该参数才生效。

StorageSpace

Integer

按空间计费(包年包月)的存储空间。

单位:GB。

说明

PolarDB MySQL标准版存储空间的取值范围:20~32000。

ProxyType

String

数据库代理类型。

取值:

  • OFF(默认):关闭数据库代理。

  • EXCLUSIVE:企业独享版

  • GENERAL:企业通用版

StandbyAZ

String

存储热备集群的可用区。

适用于标准版3AZ场景。

说明

开启了多可用区数据强一致,该参数才生效。

LooseXEngineUseMemoryPct

Integer

设置开启X-Engine存储引擎比例。

取值范围10~90的整数。

说明

当参数LooseXEngineON时,该参数才生效。

StorageUpperBound

Integer

设置标准版集群存储自动扩容上限。

单位:GB。

说明

取值最大为32000。

StrictConsistency

String

集群是否开启了多可用区数据强一致。

取值:

  • ON:表示开启了多可用区数据强一致,适用于标准版3AZ场景。

  • OFF:表示未开启多可用区数据强一致。

StoragePayType

String

存储计费类型。

取值:

  • Postpaid:按容量计费(按量付费)。

  • Prepaid:按空间计费(包年包月)。

DBNodeNum

Integer

标准版节点个数。

取值:

  • 1(默认):表示只有1个读写节点。

  • 2:表示有1个只读节点和1个读写节点。

说明

企业版默认有2个节点,标准版默认有1个节点。

仅PolarDB MySQL版支持该参数。

ProxyClass

String

标准版数据库代理规格。

取值:

  • polar.maxscale.g2.medium.c:2核。

  • polar.maxscale.g2.large.c:4核。

  • polar.maxscale.g2.xlarge.c:8核。

  • polar.maxscale.g2.2xlarge.c:16核。

  • polar.maxscale.g2.3xlarge.c:24核。

  • polar.maxscale.g2.4xlarge.c:32核。

  • polar.maxscale.g2.8xlarge.c:64核。

HotStandbyCluster

String

是否开启热备集群。

取值:

  • ON(默认):开启热备集群。

  • OFF:关闭热备集群。

  • STANDBY:标准版开启热备集群。

说明

标准版集群的默认值为STANDBY

StorageAutoScale

String

标准版集群是否开启存储自动扩容。

取值:

  • Enable:开启存储自动扩容。

  • Disable:关闭存储自动扩容。

Architecture

String

CPU 架构。

取值:

  • X86

  • ARM

DBMinorVersion

String

数据库引擎小版本号。

取值:

  • 8.0.2

  • 8.0.1

ParameterGroupId

String

参数模板ID。

您可以通过DescribeParameterGroups接口查看目标地域的参数模板列表,包括参数模板ID。

RestartMasterNode

Boolean

是否重启主节点。

取值:

  • true:重启主节点。

  • false:不重启主节点。

ColdStorageOption

Map

冷数据归档选项。

更多信息,请参见ColdStorageOption属性

Tags语法

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

Tags属性

属性名称

类型

必须

允许更新

描述

约束

Key

String

标签键。

长度为1~128个字符,不能以aliyunacs:开头,不能包含http://或者https://

Value

String

标签值。

长度为0~128个字符,不能以aliyunacs:开头,不能包含http://或者https://

DBClusterParameters语法

"DBClusterParameters": {
  "Parameters": String,
  "EffectiveTime": String
}

DBClusterParameters属性

属性名称

类型

必须

允许更新

描述

约束

Parameters

String

参数及其值的JSON字符串。

参数的值都是字符串类型。

EffectiveTime

String

参数的生效时间。

取值:

  • Auto:自动确定何时生效。

  • Immediately:立即生效。

  • MaintainTime:集群维护期间生效。

ColdStorageOption语法

"ColdStorageOption": {
  "Description": String,
  "Enable": Boolean
}

ColdStorageOption属性

属性名称

类型

必须

允许更新

描述

约束

Description

String

描述信息。

如果设置了描述信息,则表示开启了冷数据归档功能。 长度不超过256个字符。 

Enable

Boolean

开启冷数据归档功能。

取值:

  • true

  • false

返回值

Fn::GetAtt

  • DBClusterId:集群ID。

  • OrderId:订单ID。

  • DBNodeIds:集群节点ID。

  • PrimaryEndpointId:主地址ID。

  • CustomEndpointIds:自定义集群地址ID。

  • CustomConnectionStrings:自定义连接串。

  • PrimaryConnectionString:主连接串。

  • ClusterConnectionString:自定义连接串。

  • ClusterEndpointId:集群地址ID。

  • PrimaryEndpointIds:集群主地址ID列表。

  • PrimaryConnectionStrings:集群主地址连接串列表。

  • ColdStorageInstanceId:冷数据库实例ID。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      VpcId:
        AssociationProperty: ALIYUN::ECS::VPC::VPCId
        Type: String
        Description:
          en: Please search the ID starting with (vpc-xxx) from console-Virtual Private Cloud
          zh-cn: 现有虚拟专有网络的实例ID
        Label:
          en: VPC ID
          zh-cn: 专有网络VPC实例ID
      VSwitchZoneId:
        AssociationProperty: ALIYUN::ECS::Instance:ZoneId
        Type: String
        Description:
          zh-cn: 交换机可用区
          en: VSwitch Availability Zone
        Label:
          zh-cn: 交换机可用区
          en: VSwitch Availability Zone
      VSwitchId:
        AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
        AssociationPropertyMetadata:
          VpcId: ${VpcId}
          ZoneId: ${VSwitchZoneId}
        Type: String
        Description:
          en: Instance ID of existing business network switches, console-Virtual Private Cloud-VSwitches under query
          zh-cn: 现有业务网络交换机的实例ID
        Label:
          en: VSwitch ID
          zh-cn: 交换机实例ID
      DBType:
        Type: String
        Description: |-
          Database type, value:
          MySQL
          PostgreSQL
          Oracle
        Default: MySQL
      DBVersion:
        Type: String
        Description: |-
          The version of the database. Valid values:
          MySQL: 5.6 or 8.0
          PostgreSQL: 11
          Oracle: 11
        Default: '5.6'
      DBNodeClass:
        Type: String
        Description: The node specifications of the cluster. For more information, see Specifications and pricing.
        Default: polar.mysql.x4.medium
    Resources:
      DBCluster:
        Type: ALIYUN::POLARDB::DBCluster
        Properties:
          VpcId:
            Ref: VpcId
          DBType:
            Ref: DBType
          ClusterNetworkType: VPC
          ZoneId:
            Ref: VSwitchZoneId
          VSwitchId:
            Ref: VSwitchId
          DBVersion:
            Ref: DBVersion
          DBNodeClass:
            Ref: DBNodeClass
          PayType: Postpaid
    Outputs:
      DBClusterId:
        Description: The ID of the ApsaraDB for POLARDB cluster.
        Value:
          Fn::GetAtt:
            - DBCluster
            - DBClusterId
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "VpcId": {
          "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
          "Type": "String",
          "Description": {
            "en": "Please search the ID starting with (vpc-xxx) from console-Virtual Private Cloud",
            "zh-cn": "现有虚拟专有网络的实例ID"
          },
          "Label": {
            "en": "VPC ID",
            "zh-cn": "专有网络VPC实例ID"
          }
        },
        "VSwitchZoneId": {
          "AssociationProperty": "ALIYUN::ECS::Instance:ZoneId",
          "Type": "String",
          "Description": {
            "zh-cn": "交换机可用区",
            "en": "VSwitch Availability Zone"
          },
          "Label": {
            "zh-cn": "交换机可用区",
            "en": "VSwitch Availability Zone"
          }
        },
        "VSwitchId": {
          "AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
          "AssociationPropertyMetadata": {
            "VpcId": "${VpcId}",
            "ZoneId": "${VSwitchZoneId}"
          },
          "Type": "String",
          "Description": {
            "en": "Instance ID of existing business network switches, console-Virtual Private Cloud-VSwitches under query",
            "zh-cn": "现有业务网络交换机的实例ID"
          },
          "Label": {
            "en": "VSwitch ID",
            "zh-cn": "交换机实例ID"
          }
        },
        "DBType": {
          "Type": "String",
          "Description": "Database type, value:\nMySQL\nPostgreSQL\nOracle",
          "Default": "MySQL"
        },
        "DBVersion": {
          "Type": "String",
          "Description": "The version of the database. Valid values:\nMySQL: 5.6 or 8.0\nPostgreSQL: 11\nOracle: 11",
          "Default": "5.6"
        },
        "DBNodeClass": {
          "Type": "String",
          "Description": "The node specifications of the cluster. For more information, see Specifications and pricing.",
          "Default": "polar.mysql.x4.medium"
        }
      },
      "Resources": {
        "DBCluster": {
          "Type": "ALIYUN::POLARDB::DBCluster",
          "Properties": {
            "VpcId": {
              "Ref": "VpcId"
            },
            "DBType": {
              "Ref": "DBType"
            },
            "ClusterNetworkType": "VPC",
            "ZoneId": {
              "Ref": "VSwitchZoneId"
            },
            "VSwitchId": {
              "Ref": "VSwitchId"
            },
            "DBVersion": {
              "Ref": "DBVersion"
            },
            "DBNodeClass": {
              "Ref": "DBNodeClass"
            },
            "PayType": "Postpaid"
          }
        }
      },
      "Outputs": {
        "DBClusterId": {
          "Description": "The ID of the ApsaraDB for POLARDB cluster.",
          "Value": {
            "Fn::GetAtt": [
              "DBCluster",
              "DBClusterId"
            ]
          }
        }
      }
    }

更多示例,请参见创建PolarDB集群、为PolarDB数据库创建账号、在PolarDB集群下创建一个新的数据库、增加PolarDB集群节点、授权普通账号访问PolarDB集群的某个数据库、修改允许访问数据库集群的IP名单和创建PolarDB集群的公网地址的组合示例:JSON示例YAML示例

  • 本页导读 (1)
文档反馈