All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::POLARDB::DBCluster

Last Updated:Dec 05, 2023

ALIYUN::POLARDB::DBCluster is used to create a PolarDB cluster.

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

VpcId

String

No

No

The virtual private cloud (VPC) ID.

None.

DBClusterDescription

String

No

Yes

The description of the cluster.

The description must be 2 to 256 characters in length, and can contain letters, digits, commas (,), and hyphens (-). The description must start with a letter but cannot start with http:// or https://.

DBType

String

Yes

No

The type of the database engine.

Valid values:

  • MySQL

  • PostgreSQL

  • Oracle

ClusterNetworkType

String

No

No

The network type of the cluster.

Set the value to VPC.

RenewalStatus

String

No

Yes

The auto-renewal state of the cluster.

Valid values:

  • AutoRenewal: The cluster is automatically renewed.

  • Normal (default): The cluster is manually renewed.

  • NotRenewal: The cluster is not renewed.

    Note

    If you set this property to NotRenewal, the system does not send a reminder for expiration. The system sends a non-renewal reminder three days before the cluster expires.

AutoRenewPeriod

Integer

No

Yes

The auto-renewal period of the cluster.

Valid values:

  • 1 (default)

  • 2

  • 3

  • 6

  • 12

  • 24

  • 36

Unit: months.

Period

Integer

No

No

The subscription duration of the cluster. If you set the PayType property to Prepaid, you must specify this property.

Valid values:

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 12

  • 24

  • 36

Unit: months.

ZoneId

String

No

No

The zone ID of the cluster.

You can call the DescribeRegions operation to query the available zones.

SourceResourceId

String

No

No

The ID of the source ApsaraDB RDS instance or PolarDB cluster.

This property takes effect when you set the DBType property to MySQL and the DBVersion property to 5.6. The SourceResourceId property is required if you do not set the CreationOption property to Normal.

SecurityGroupIds

List

No

Yes

The IDs of the security groups.

You can specify up to three security groups.

Tags

List

No

Yes

The tags of the cluster.

You can specify up to 20 tags.

For more information, see Tags properties.

MaintainTime

String

No

Yes

The maintenance window of the cluster.

Specify the maintenance window in the ISO 8601 standard in the HH:mmZ-HH:mmZ format. For example, if you want to maintain the cluster from 00:00:00 to 01:00:00 (UTC+8), set this property to 16:00Z-17:00Z.

DBVersion

String

Yes

No

The version of the database engine.

Valid values:

  • If the DBType property is set to MySQL: 5.6 and 8.0.

  • If the DBType property is set to PostgreSQL: 11.

  • If the DBType property is set to Oracle: 11.

CreationOption

String

No

No

The method that you want use to create the cluster.

Valid values:

  • Normal (default): creates a PolarDB cluster from scratch.

  • CloneFromPolarDB: clones data from an existing PolarDB cluster to create a PolarDB cluster.

  • CloneFromRDS: clones data from an existing ApsaraDB RDS instance to create a PolarDB cluster.

  • MigrationFromRDS: migrates data from an existing ApsaraDB RDS instance to create a PolarDB cluster.

If you set the DBType property to MySQL and the DBVersion property to 5.6, you must set the CreationOption property to CloneFromRDS or MigrationFromRDS.

DBNodeClass

String

Yes

No

The instance type of the node.

For more information, see Billable items.

VSwitchId

String

No

No

The vSwitch ID of the cluster.

None.

SecurityIPList

String

No

No

The IP address whitelist of the cluster.

None.

CloneDataPoint

String

No

No

The point in time at which you want to clone data.

Valid values:

  • LATEST (default): the latest point in time.

    Note

    If you set the CreationOption property to CloneFromRDS, you must set the CloneDataPoint property to LATEST.

  • BackupID: the point in time at which a backup set is created.

  • Timestamp: the historical point in time. Specify the time in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC.

This property takes effect when you set the DBType property to MySQL, the DBVersion property to 5.6, and the CreationOption property to CloneFromRDS or CloneFromPolarDB.

PayType

String

Yes

No

The billing method of the cluster.

Valid values:

  • Postpaid: pay-as-you-go

  • Prepaid: subscription

CreationCategory

String

No

No

The cluster edition.

Set the value to Normal, which specifies Standard Edition.

BackupRetentionPolicyOnClusterDeletion

String

No

No

The retention policy for the backup sets when you delete the cluster.

Valid values:

  • ALL: permanently retains all backups.

  • LATEST: permanently retains the latest backup. A backup is automatically created before you delete the cluster.

  • NONE (default): does not retain backup sets.

Note

This property takes effect only when you set the DBType property to MySQL.

ResourceGroupId

String

No

Yes

The ID of the resource group.

None.

DefaultTimeZone

String

No

No

The time zone of the cluster. The time zone must be in UTC.

Default value: SYSTEM. The default time zone of the cluster is the same as the time zone of the region.

You can set this property to a value that is on the hour from -12:00:00 to +13:00:00. Example: 00:00:00.

Note

This property takes effect only when you set the DBType property to MySQL.

GDNId

String

No

No

The ID of the Global Database Network (GDN).

This property is required if you set the CreationOption property to CreateGdnStandby.

LowerCaseTableNames

Integer

No

No

Specifies whether table names are case-sensitive.

Valid values:

  • 1 (default): Table names are not case-sensitive.

  • 0: Table names are case-sensitive.

Note

This property takes effect only when you set the DBType property to MySQL.

DBClusterParameters

Map

No

Yes

The parameters of the cluster.

For more information, see DBClusterParameters properties.

TDEStatus

Boolean

No

Yes

Specifies whether to enable transparent data encryption (TDE).

Valid values:

  • true: enables TDE.

    Note

    You cannot disable TDE after TDE is enabled.

  • false: does not enable TDE.

Note

The property takes effect when you set the DBType property to PostgreSQL or Oracle.

PeriodUnit

String

No

No

The unit of the subscription duration.

Valid values:

  • Year

  • Month

ScaleRoNumMin

Integer

No

No

The minimum number of read-only nodes that you can scale in the cluster.

None.

ScaleMax

Integer

No

No

The maximum number of nodes that you can scale in the cluster.

None.

AllowShutDown

Boolean

No

No

Specifies whether to enable the no-activity suspension feature.

Valid values:

  • true

  • false

ServerlessType

String

No

No

The serverless type of the cluster.

Set the value to AgileServerless.

ScaleRoNumMax

Integer

No

No

The maximum number of read-only nodes that you can scale in the cluster.

None.

ScaleMin

Integer

No

No

The minimum number of nodes that you can scale in the cluster.

None.

StorageType

String

No

No

The storage type of the cluster.

Valid values for Enterprise Edition clusters:

  • PSL5

  • PSL4

Valid values for Standard Edition clusters:

  • ESSDPL1

  • ESSDPL2

  • ESSDPL3

Note

This property is not supported by serverless clusters.

LooseXEngine

String

No

No

Specifies whether to enable the X-Engine feature.

Valid values:

  • ON

  • OFF

Note

This property takes effect only if you do not set CreationOption to CreateGdnStandby, and you set DBType to MySQL, and DBVersion to 8.0. To enable X-Engine, the memory size of the node must be no less than 16 GB.

LoosePolarLogBin

String

No

No

Specifies whether to enable the binary logging feature.

Valid values:

  • ON

  • OFF

Note

This property takes effect when you set the DBType property to MySQL.

StorageSpace

Integer

No

No

The storage space that is billed based on the subscription billing method.

Unit: GB.

Note

Valid values for PolarDB for MySQL Standard Edition: 20 to 32000.

ProxyType

String

No

No

The type of the database proxy.

Valid values:

  • OFF (default): The database proxy feature is disabled.

  • EXCLUSIVE: The database proxy is of Dedicated Enterprise Edition.

  • GENERAL: The database proxy is of Standard Enterprise Edition.

StandbyAZ

String

No

No

The zone where the hot standby storage cluster is stored.

This property is suitable for Standard Edition clusters of Multi-zone Edition.

Note

This property takes effect only when the multi-zone data consistency feature is enabled.

LooseXEngineUseMemoryPct

Integer

No

No

The X-Engine memory usage rate.

The value is an integer that ranges from 10 to 90.

Note

This property takes effect only when you set the LooseXEngine property to ON.

StorageUpperBound

Integer

No

No

The maximum storage capacity that is allowed for automatic storage expansion of the Standard Edition cluster.

Unit: GB.

Note

Maximum value: 32000.

StrictConsistency

String

No

No

Specifies whether to enable the multi-zone data consistency feature.

Valid values:

  • ON: enables the multi-zone data consistency feature, which is suitable for Standard Edition clusters of Multi-zone Edition.

  • OFF: disables the multi-zone data consistency feature.

StoragePayType

String

No

No

The billing method of the storage space.

Valid values:

  • Postpaid: pay-as-you-go

  • Prepaid: subscription

DBNodeNum

Integer

No

No

The number of Standard Edition nodes.

Valid values:

  • 1 (default): only one read-write node.

  • 2: one read-only node and one read-write node.

Note

Default value for Enterprise Edition: 2. Default values for Standard Edition: 1.

This property takes effect only for PolarDB for MySQL clusters.

ProxyClass

String

No

No

The specifications of the Standard Edition PolarProxy.

Valid values:

  • polar.maxscale.g2.medium.c: 2 cores

  • polar.maxscale.g2.large.c: 4 cores

  • polar.maxscale.g2.xlarge.c: 8 cores

  • polar.maxscale.g2.2xlarge.c: 16 cores

  • polar.maxscale.g2.3xlarge.c: 24 cores

  • polar.maxscale.g2.4xlarge.c: 32 cores

  • polar.maxscale.g2.8xlarge.c: 64 cores

HotStandbyCluster

String

No

No

Specifies whether to enable the hot standby storage cluster feature.

Valid values:

  • ON (default): enables the hot standby storage cluster feature.

  • OFF: disables the hot standby storage cluster feature.

  • STANDBY: enables the hot standby storage cluster feature only for Standard Edition clusters.

Note

The default value for Standard Edition clusters is STANDBY.

StorageAutoScale

String

No

No

Specifies whether to enable the automatic storage expansion feature for Standard Edition clusters.

Valid values:

  • Enable

  • Disable

Architecture

String

No

No

The architecture of the CPU.

Valid values:

  • X86

  • ARM

DBMinorVersion

String

No

No

The minor version of the cluster.

Valid values:

  • 8.0.2

  • 8.0.1

ParameterGroupId

String

No

No

The ID of the property template.

You can call the DescribeParameterGroups operation to query the parameter templates of a region, including the IDs of the parameter templates.

RestartMasterNode

Boolean

No

No

Specifies whether to restart the primary node.

Valid values:

  • true

  • false

ColdStorageOption

Map

No

No

The option for cold data archiving.

For more information, see ColdStorageOption properties.

Tags syntax

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

Tags properties

Property

Type

Required

Editable

Description

Constraint

Key

String

Yes

No

The tag key.

The tag key must be 1 to 128 characters in length, and cannot contain http:// or https://. The tag key cannot start with aliyun or acs:.

Value

String

No

No

The tag value.

The tag value can be up to 128 characters in length, and cannot contain http:// or https://. The tag value cannot start with aliyun or acs:.

DBClusterParameters syntax

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

DBClusterParameters property

Property

Type

Required

Editable

Description

Constraint

Parameters

String

No

Yes

The JSON string that consists of the parameters of the cluster and the parameter values.

All the parameter values are of the string type.

EffectiveTime

String

No

Yes

The time when the parameters take effect.

Valid values:

  • Auto: The system automatically determines when the parameters take effect.

  • Immediately: The parameters immediately take effect after you configure them.

  • MaintainTime: The parameters take effect during the maintenance window of the cluster.

ColdStorageOption syntax

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

ColdStorageOption properties

Property

Type

Required

Editable

Description

Constraint

Description

String

No

No

The description of the cold data archiving feature.

If you specify this property, the cold data archiving feature is enabled. The description can be up to 256 characters in length.  

Enable

Boolean

No

No

Specifies whether to enable the cold data archiving feature.

Valid values:

  • true

  • false

Return values

Fn::GetAtt

  • DBClusterId: the cluster ID.

  • OrderId: the order ID.

  • DBNodeIds: the IDs of the nodes in the cluster.

  • PrimaryEndpointId: the primary endpoint ID.

  • CustomEndpointIds: the IDs of the custom cluster endpoints.

  • CustomConnectionStrings: the custom connection strings of the cluster.

  • PrimaryConnectionString: the primary connection string of the cluster.

  • ClusterConnectionString: the custom connection string of the cluster.

  • ClusterEndpointId: the cluster endpoint ID.

  • PrimaryEndpointIds: the primary endpoint IDs of the cluster.

  • PrimaryConnectionStrings: the primary endpoints of the cluster.

  • ColdStorageInstanceId: the ID of the instance with the cold data archiving feature enabled.

Examples

  • YAML format

    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: the ID of the instance that resides in the existing VPC.
        Label:
          en: VPC ID
          zh-cn: the VPC ID.
      VSwitchZoneId:
        AssociationProperty: ALIYUN::ECS::Instance:ZoneId
        Type: String
        Description:
          zh-cn: the vSwitch zone
          en: VSwitch Availability Zone
        Label:
          zh-cn: the vSwitch zone
          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: the ID of the instance that is associated with the existing vSwitch.
        Label:
          en: VSwitch ID
          zh-cn: the vSwitch 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 format

    {
      "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: the ID of the instance that resides in the existing VPC.
          },
          "Label": {
            "en": "VPC ID",
            zh-cn: the VPC ID.
          }
        },
        "VSwitchZoneId": {
          "AssociationProperty": "ALIYUN::ECS::Instance:ZoneId",
          "Type": "String",
          "Description": {
            zh-cn: the vSwitch zone
            "en": "VSwitch Availability Zone"
          },
          "Label": {
            zh-cn: the vSwitch zone
            "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: the ID of the instance that is associated with the existing vSwitch.
          },
          "Label": {
            "en": "VSwitch ID",
            zh-cn: the vSwitch 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"
            ]
          }
        }
      }
    }

For more examples, visit POLARDB.json and POLARDB.yml. In the examples, the ALIYUN::POLARDB::DBCluster, ALIYUN::POLARDB::Account, ALIYUN::POLARDB::DBInstance, ALIYUN::POLARDB::DBNodes, ALIYUN::POLARDB::AccountPrivilege, ALIYUN::POLARDB::DBClusterAccessWhiteList, and ALIYUN::POLARDB::DBClusterEndpointAddress resource types are used.