All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::POLARDB::DBCluster

Last Updated:Nov 20, 2024

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,
    "ProvisionedIops": Integer
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

VpcId

String

No

No

The ID of the virtual private cloud (VPC).

None.

DBClusterDescription

String

No

Yes

The description of the cluster.

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

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.

Only VPCs are supported. Set the value to VPC.

RenewalStatus

String

No

Yes

The auto-renewal status 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 an expiration reminder, but sends only a non-renewal reminder three days before the expiration date.

AutoRenewPeriod

Integer

No

Yes

The auto-renewal period of the cluster.

Valid values:

  • 1 (default)

  • 2

  • 3

  • 6

  • 12

  • 24

  • 36

Unit: month.

Period

Integer

No

No

The subscription duration of the cluster. This property takes effect when PayType is set to Prepaid.

Valid values:

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 12

  • 24

  • 36

Unit: month.

ZoneId

String

No

No

The zone ID.

You can call the DescribeRegions operation to query available zones.

SourceResourceId

String

No

No

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

This property takes effect when DBType is set to MySQL and DBVersion is set to 5.6. You must specify SourceResourceId when CreationOption is not set 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.

You can add 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 set this property to 16:00Z-17:00Z, the cluster is maintained from 00:00:00 to 01:00:00 (UTC+8).

DBVersion

String

Yes

No

The version of the database engine.

  • Valid values when DBType is set to MySQL: 5.6 and 8.0.

  • Valid value when DBType is set to PostgreSQL: 11.

  • Valid value when DBType is set to Oracle: 11.

CreationOption

String

No

No

The method that you want to use to create the cluster.

Valid values:

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

  • CloneFromPolarDB: creates a PolarDB cluster by cloning data from an existing PolarDB cluster.

  • CloneFromRDS: creates a PolarDB cluster by cloning data from an existing ApsaraDB RDS instance.

  • MigrationFromRDS: creates a PolarDB cluster by migrating data from an existing ApsaraDB RDS instance.

When DBType is set to MySQL and DBVersion is set to 5.6, you must set CreationOption 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.

None.

SecurityIPList

String

No

No

The IP address whitelist of the cluster.

None.

CloneDataPoint

String

No

No

The point in time of the data that you want to clone.

Valid values:

  • LATEST (default): the most recent point in time.

    Note

    You must set CloneDataPoint to LATEST when CreationOption is set to CloneFromRDS.

  • BackupID: the ID of a historical backup set.

  • 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 DBType is set to MySQL, DBVersion is set to 5.6, and CreationOption is set to CloneFromRDS or CloneFromPolarDB.

PayType

String

Yes

No

The billing method.

Valid values:

  • Postpaid: pay-as-you-go

  • Prepaid: subscription

CreationCategory

String

No

No

The edition of the cluster.

Set the value to Normal. A value of Normal specifies Standard Edition.

BackupRetentionPolicyOnClusterDeletion

String

No

No

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

Valid values:

  • ALL: permanently retains all backups.

  • LATEST: permanently retains the last 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 DBType is set 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 to +13:00. Example: 00:00.

Note

This property takes effect only when DBType is set to MySQL.

GDNId

String

No

No

The ID of the Global Database Network (GDN).

You must specify this property when CreationOption is set to CreateGdnStandby.

LowerCaseTableNames

Integer

No

No

Specifies whether the table names are case-insensitive.

Valid values:

  • 1 (default): The table names are case-insensitive.

  • 0: The table names are case-sensitive.

Note

This property takes effect only when DBType is set 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

    Note

    You cannot disable TDE once it is enabled.

  • false (default)

Note

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

PeriodUnit

String

No

No

The unit of the billing cycle.

Valid values:

  • Year

  • Month

ScaleRoNumMin

Integer

No

No

The minimum number of read-only nodes for scaling.

None.

ScaleMax

Integer

No

No

The maximum number of PolarDB Capacity Units (PCUs) per node for scaling.

None.

AllowShutDown

Boolean

No

No

Specifies whether to enable the no-activity suspension feature.

Valid values:

  • true

  • false

ServerlessType

String

No

No

The type of the serverless cluster.

Set the value to AgileServerless.

ScaleRoNumMax

Integer

No

No

The maximum number of read-only nodes for scaling.

None.

ScaleMin

Integer

No

No

The maximum number of PCUs per node for scaling.

None.

StorageType

String

No

No

The storage type.

Valid values for Enterprise Edition:

  • PSL5

  • PSL4

Valid values for Standard Edition:

  • ESSDPL1

  • ESSDPL2

  • ESSDPL3

Note

This property is not supported for serverless clusters.

LooseXEngine

String

No

No

Specifies whether to enable the X-Engine feature.

Valid values:

  • ON

  • OFF

Note

This property takes effect only when CreationOption is not set to CreateGdnStandby, DBType is set to MySQL, and DBVersion is set to 8.0. To enable the X-Engine feature on a node, you must make sure that the memory size of the node is greater than or equal to 16 GB.

LoosePolarLogBin

String

No

No

Specifies whether to enable the binary logging feature.

Valid values:

  • ON

  • OFF

Note

This property takes effect only when DBType is set to MySQL.

StorageSpace

Integer

No

No

The subscription storage capacity.

Unit: GB.

Note

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

ProxyType

String

No

No

The edition of PolarProxy.

Valid values:

  • OFF (default): no edition. PolarProxy is disabled.

  • EXCLUSIVE: PolarProxy is of Dedicated Enterprise Edition.

  • GENERAL: PolarProxy is of Standard Enterprise Edition.

StandbyAZ

String

No

No

The zone of the hot standby storage cluster.

This property is applicable to 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 memory usage proportion of X-Engine.

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

Note

This property takes effect only when LooseXEngine is set 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 for the cluster.

Valid values:

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

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

StoragePayType

String

No

No

The storage billing method.

Valid values:

  • Postpaid: pay-as-you-go

  • Prepaid: subscription

DBNodeNum

Integer

No

No

The number of nodes in the Standard Edition cluster.

Valid values:

  • 1 (default): only one primary node.

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

Note

By default, an Enterprise Edition cluster has two nodes and a Standard Edition cluster has one node.

This property is supported only for PolarDB for MySQL clusters.

ProxyClass

String

No

No

The specification of the Standard Edition PolarProxy.

Valid values:

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

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

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

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

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

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

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

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 for Standard Edition clusters.

Note

The default value for Standard Edition clusters is STANDBY.

StorageAutoScale

String

No

No

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

Valid values:

  • Enable

  • Disable

Architecture

String

No

No

The CPU architecture.

Valid values:

  • X86

  • ARM

DBMinorVersion

String

No

No

The minor version of the database engine.

Valid values:

  • 8.0.2

  • 8.0.1

ParameterGroupId

String

No

No

The ID of the parameter template.

You can call the DescribeParameterGroups operation to query the information about parameter templates in a specified region, including the parameter template IDs.

RestartMasterNode

Boolean

No

No

Specifies whether to restart the primary node.

Valid values:

  • true

  • false

ColdStorageOption

Map

No

No

The options for the cold data archiving feature.

For more information, see ColdStorageOption properties.

ProvisionedIops

Integer

No

No

The provisioned read/write IOPS of the Enterprise SSD (ESSD) AutoPL disk.

Valid values: 0 to min{50,000, 1,000 × Capacity - Baseline IOPS}.

The baseline IOPS is calculated based on the following equation: Baseline IOPS = min{1,800 + 50 × Capacity, 50,000}.

Note

This property is supported only when StorageType is set to ESSDAUTOPL.

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://. It 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://. It cannot start with aliyun or acs:.

DBClusterParameters syntax

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

DBClusterParameters properties

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.

The parameter values are of the String data type.

EffectiveTime

String

No

Yes

The time when the parameter takes effect.

Valid values:

  • Auto: The system automatically determines when the parameter takes effect.

  • Immediately: The parameter immediately takes effect after it is configured.

  • MaintainTime: The parameter takes 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.

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 of the cluster.

  • CustomEndpointIds: the custom endpoint IDs of the cluster.

  • CustomConnectionStrings: the custom endpoints of the cluster.

  • PrimaryConnectionString: the primary endpoint of the cluster.

  • ClusterConnectionString: the custom endpoint of the cluster.

  • ClusterEndpointId: the cluster endpoint ID of the cluster.

  • PrimaryEndpointIds: the primary endpoint IDs of the cluster.

  • PrimaryConnectionStrings: the primary endpoints of the cluster.

  • ColdStorageInstanceId: the ID of the instance for which the cold data archiving feature is enabled.

  • DBClusterDescription: the description of the cluster.

Examples

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
       
    Label:
      en: VPC ID
       
  VSwitchZoneId:
    AssociationProperty: ALIYUN::ECS::Instance:ZoneId
    Type: String
    Description:
       
      en: VSwitch Availability Zone
    Label:
       
      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
       
    Label:
      en: 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
{
  "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",
         
      },
      "Label": {
        "en": "VPC ID",
         
      }
    },
    "VSwitchZoneId": {
      "AssociationProperty": "ALIYUN::ECS::Instance:ZoneId",
      "Type": "String",
      "Description": {
         
        "en": "VSwitch Availability Zone"
      },
      "Label": {
         
        "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",
         
      },
      "Label": {
        "en": "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.yml. In the examples, the following resource types are used: ALIYUN::POLARDB::DBCluster, ALIYUN::POLARDB::Account, ALIYUN::POLARDB::DBInstance, ALIYUN::POLARDB::DBNodes, ALIYUN::POLARDB::AccountPrivilege, ALIYUN::POLARDB::DBClusterAccessWhiteList, and ALIYUN::POLARDB::DBClusterEndpointAddress.