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 |
DBType | String | Yes | No | The type of the database engine. | Valid values:
|
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:
|
AutoRenewPeriod | Integer | No | Yes | The auto-renewal period of the cluster. | Valid values:
Unit: month. |
Period | Integer | No | No | The subscription duration of the cluster. This property takes effect when PayType is set to Prepaid. | Valid values:
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. |
|
CreationOption | String | No | No | The method that you want to use to create the cluster. | Valid values:
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:
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:
|
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:
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:
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:
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:
|
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:
|
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:
Valid values for Standard Edition:
Note This property is not supported for serverless clusters. |
LooseXEngine | String | No | No | Specifies whether to enable the X-Engine feature. | Valid values:
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:
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:
|
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:
|
StoragePayType | String | No | No | The storage billing method. | Valid values:
|
DBNodeNum | Integer | No | No | The number of nodes in the Standard Edition cluster. | Valid values:
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:
|
HotStandbyCluster | String | No | No | Specifies whether to enable the hot standby storage cluster feature. | Valid values:
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:
|
Architecture | String | No | No | The CPU architecture. | Valid values:
|
DBMinorVersion | String | No | No | The minor version of the database engine. | Valid values:
|
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:
|
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 |
Value | String | No | No | The tag value. | The tag value can be up to 128 characters in length, and cannot contain |
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:
|
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:
|
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.