The ALIYUN::POLARDB::DBCluster resource type creates 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,
"DeletionProtection": Boolean,
"SSLEnabled": String
}
}Properties
Property | Type | Required | Update allowed | Description | Constraints |
DBType | String | Yes | No | The type of the database engine. | Valid values:
|
DBNodeClass | String | Yes | No | The specifications of the node. | For more information about node specifications, see the following documents:
Note To create a Serverless cluster for a PolarDB for MySQL Cluster Edition cluster, set this parameter to polar.mysql.sl.small. To create a Serverless cluster for a PolarDB for MySQL Standard Edition cluster, set this parameter to polar.mysql.sl.small.c. To create a Serverless cluster for a PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL cluster, set this parameter to polar.pg.sl.small.c. |
DBVersion | String | Yes | No | The version of the database engine. | Valid values:
|
PayType | String | Yes | Yes | The billing method. | Valid values:
|
AutoRenewPeriod | Integer | No | Yes | The auto-renewal period of the instance. | Valid values:
Unit: month. |
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 or a Chinese character. It cannot start with |
ClusterNetworkType | String | No | No | The network type of the cluster. | Only VPC is supported. Set the value to VPC. |
RenewalStatus | String | No | Yes | The auto-renewal status. | Valid values:
|
Period | Integer | No | Yes | The subscription duration of the instance if you set PayType to Prepaid. | Valid values:
Unit: month. |
ZoneId | String | No | No | The ID of the zone. | You can call the DescribeRegions operation to query the available zones. |
SourceResourceId | String | No | No | The ID of the source RDS instance or PolarDB cluster. | The ID of the source RDS instance or PolarDB cluster. This parameter is required only if CreationOption is set to MigrationFromRDS, CloneFromRDS, CloneFromPolarDB, or RecoverFromRecyclebin.
|
SecurityGroupIds | List | No | Yes | The IDs of the security groups. | You can specify a maximum of three security groups. |
Tags | List | No | Yes | The tags. | You can add a maximum of 20 tags. For more information, see Tags properties. |
MaintainTime | String | No | Yes | The maintenance window of the cluster. | The time is in the HH:mmZ-HH:mmZ format. For example, 16:00Z-17:00Z indicates that routine maintenance can be performed from 00:00 to 01:00 (UTC+8). |
CreationOption | String | No | No | The method that is used to create the cluster. | Valid values:
Default value: Normal. Note If DBType is set to MySQL and DBVersion is set to 8.0, you can set this parameter to CreateGdnStandby. |
VSwitchId | String | No | No | The ID of the vSwitch. | None |
SecurityIPList | String | No | No | The IP address whitelist of the PolarDB cluster. | Note You can add multiple IP addresses to the whitelist. Separate the IP addresses with commas (,). |
CloneDataPoint | String | No | No | The point in time from which you want to clone data. | Valid values:
Note If CreationOption is set to CloneFromRDS, you can set this parameter only to LATEST. |
CreationCategory | String | No | No | The edition of the cluster. | Valid values:
Note The Basic edition is supported for PolarDB for MySQL 5.6, 5.7, and 8.0, PolarDB for PostgreSQL 14, and PolarDB for PostgreSQL (Compatible with Oracle) 2.0. MySQL 8.0 supports ArchiveNormal and NormalMultimaster. The SENormal edition is supported for PolarDB for MySQL 5.6, 5.7, and 8.0, and PolarDB for PostgreSQL 14. |
BackupRetentionPolicyOnClusterDeletion | String | No | No | The data retention policy for backup sets when you delete the cluster. | Valid values:
When you create a cluster, the default value is NONE. This means that backup sets are not retained when the cluster is deleted. Note
|
ResourceGroupId | String | No | Yes | The ID of the resource group. | None |
DefaultTimeZone | String | No | No | The time zone of the cluster. The time must be in UTC. | The default value is SYSTEM, which indicates that the time zone is the same as the time zone of the region. You can set this parameter to a value that is on the hour from -12:00 to +13:00, such as 00:00. Note This parameter is valid only if DBType is set to MySQL. |
GDNId | String | No | No | The ID of the Global Database Network (GDN). | This parameter is required if CreationOption is set to CreateGdnStandby. |
LowerCaseTableNames | Integer | No | No | Specifies whether table names are case-sensitive. | Valid values:
Note This parameter is valid only if DBType is set to MySQL. |
DBClusterParameters | Map | No | Yes | The parameters of the PolarDB cluster. | For more information, see DBClusterParameters properties. |
DeletionProtection | Boolean | No | Yes | Specifies whether to enable deletion protection. | Valid values:
|
TDEStatus | Boolean | No | Yes | Specifies whether to enable transparent data encryption (TDE). | Valid values:
Note This parameter is valid only if DBType is set to PostgreSQL or Oracle. |
PeriodUnit | String | No | Yes | The unit of the subscription duration. | Valid values:
|
ScaleRoNumMin | Integer | No | No | The minimum number of read-only nodes for scaling. | Valid values: 0 to 15. Note This parameter is supported only for Serverless clusters. |
ScaleMax | Integer | No | No | Maximum single-node scale-out and scale-in limits. | Valid values: 1 PCU to 32 PCU. Note This parameter is supported only for Serverless clusters. |
AllowShutDown | Boolean | No | No | Specifies whether to enable No-activity Suspension. | Valid values:
Note This parameter is supported only for Serverless clusters. |
ServerlessType | String | No | No | The type of the Serverless service. | Set the value to AgileServerless. Note This parameter is supported only for Serverless clusters. |
ScaleRoNumMax | Integer | No | No | The maximum number of read-only nodes for scaling. | Valid values: 0 to 15. Note This parameter is supported only for Serverless clusters. |
ScaleMin | Integer | No | No | The minimum number of PCUs for a single node for scaling. | Valid values: 1 PCU to 31 PCU. Note This parameter is supported only for Serverless clusters. |
SSLEnabled | String | No | Yes | Modifies the SSL status. | Valid values:
|
StorageType | String | No | No | The storage class. | Valid values for Enterprise Edition clusters:
Valid values for Standard Edition clusters:
|
LooseXEngine | String | No | No | Specifies whether to enable the X-Engine storage engine. | Valid values:
Note This parameter is valid only if CreationOption is not set to CreateGdnStandby, DBType is set to MySQL, and DBVersion is set to 8.0. The memory of a node on which X-Engine is enabled must be 16 GB or larger. |
LoosePolarLogBin | String | No | No | Specifies whether to enable binary logging. | Valid values:
Note This parameter is valid only if DBType is set to MySQL. |
StorageSpace | Integer | No | No | The storage space of the subscription cluster. | Unit: GB. Note
|
ProxyType | String | No | No | The edition of the database proxy. | Valid values:
Note The proxy edition must be the same as the edition of the cluster nodes. If the nodes are of the General-purpose specification, set the proxy edition to Standard Enterprise Edition. If the nodes are of the Dedicated specification, set the proxy edition to Dedicated Enterprise Edition. |
StandbyAZ | String | No | No | The zone of the hot standby storage cluster. | This parameter is applicable to three-zone Standard Edition clusters. Note This parameter is valid only if strong consistency is enabled for the multi-zone cluster. |
LooseXEngineUseMemoryPct | Integer | No | No | Set the proportion for the X-Engine storage engine. | An integer from 10 to 90. Note This parameter is valid only if LooseXEngine is set to ON. |
StorageUpperBound | Integer | No | No | The upper limit for the automatic storage expansion of a Standard Edition cluster. | Unit: GB. Note The maximum value is 32000. |
StrictConsistency | String | No | No | Specifies whether to enable strong consistency for the multi-zone cluster. | Valid values:
|
StoragePayType | String | No | No | The billing method for storage. | Valid values:
|
DBNodeNum | Integer | No | No | The number of nodes for Standard Edition and Enterprise Edition clusters. | Valid values:
Note
|
ProxyClass | String | No | No | The specifications of the database proxy for a Standard Edition cluster. | Valid values:
|
HotStandbyCluster | String | No | No | Specifies whether to enable the Hot Standby 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 a Standard Edition cluster. | Valid values:
|
Architecture | String | No | No | The CPU architecture. | Valid values:
|
DBMinorVersion | String | No | No | The minor version of the database engine. | Valid values:
Note This parameter is valid only if DBType is set to MySQL and DBVersion is set to 8.0. |
VpcId | String | No | No | The ID of the virtual private cloud (VPC). | None |
ParameterGroupId | String | No | No | The ID of the parameter template. | You can call the DescribeParameterGroups operation to query the parameter templates in the destination 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 cold data archiving. | For more information, see ColdStorageOption properties. |
ProvisionedIops | Integer | No | No | The provisioned read/write IOPS of the ESSD AutoPL disk. | Valid values: 0 to min{50,000, 1,000 × Capacity - Baseline IOPS}. Baseline IOPS = min{1,800 + 50 × Capacity, 50,000}. Note This parameter is supported only if StorageType is set to ESSDAUTOPL. |
Tags syntax
"Tags": [
{
"Key": String,
"Value": String
}
] Tags properties
Property | Type | Required | Update allowed | Description | Constraints |
Key | String | Yes | No | The key of the tag. | The key must be 1 to 128 characters in length. It cannot start with |
Value | String | No | No | The value of the tag. | The value must be 0 to 128 characters in length. It cannot start with |
DBClusterParameters syntax
"DBClusterParameters": {
"Parameters": String,
"EffectiveTime": String
}DBClusterParameters properties
Property | Type | Required | Update allowed | Description | Constraints |
Parameters | String | No | Yes | The JSON string that consists of the parameters and their values. | The parameter values are of the string 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 | Update allowed | Description | Constraints |
Description | String | No | No | The description. | If you specify a description, 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 ID of the cluster.
OrderId: The ID of the order.
DBNodeIds: The IDs of the cluster nodes.
PrimaryEndpointId: The ID of the primary endpoint.
CustomEndpointIds: The IDs of the custom endpoints.
CustomConnectionStrings: The custom connection strings.
PrimaryConnectionString: The primary connection string.
ClusterConnectionString: The cluster connection string.
ClusterEndpointId: The ID of the cluster endpoint.
PrimaryEndpointIds: The list of primary endpoint IDs.
PrimaryConnectionStrings: The list of primary connection strings.
ColdStorageInstanceId: The ID of the cold storage instance.
DBClusterDescription: The description of the cluster.
Arn: The Alibaba Cloud Resource Name (ARN) of the cluster.
Examples
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
VpcId:
AssociationProperty: ALIYUN::ECS::VPC::VPCId
Type: String
Description:
en: The ID of the VPC. You can find the ID that starts with vpc- in the Virtual Private Cloud console.
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: The ID of the vSwitch. You can find the ID in the Virtual Private Cloud console.
Label:
en: VSwitch ID
DBType:
Type: String
Description: |-
Database type. Valid values:
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 PolarDB cluster.
Value:
Fn::GetAtt:
- DBCluster
- DBClusterId{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"VpcId": {
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
"Type": "String",
"Description": {
"en": "The ID of the VPC. You can find the ID that starts with vpc- in the Virtual Private Cloud console."
},
"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": "The ID of the vSwitch. You can find the ID in the Virtual Private Cloud console."
},
"Label": {
"en": "VSwitch ID"
}
},
"DBType": {
"Type": "String",
"Description": "Database type. Valid values:\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 PolarDB cluster.",
"Value": {
"Fn::GetAtt": [
"DBCluster",
"DBClusterId"
]
}
}
}
}PolarDB for PostgreSQL Serverless example
ROSTemplateFormatVersion: '2015-09-01'
Resources:
VPC:
Type: ALIYUN::ECS::VPC
Properties:
VpcName: polardb-test
CidrBlock: 192.168.0.0/16
VSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
VSwitchName: polardb-test
VpcId:
Ref: VPC
CidrBlock: 192.168.1.0/24
ZoneId: cn-beijing-k
PolardbCluster:
Type: ALIYUN::POLARDB::DBCluster
Properties:
VpcId:
Ref: VPC
CreationCategory: Normal
StorageType: PSL5
DBType: PostgreSQL
ClusterNetworkType: VPC
DBVersion: '16'
PayType: Postpaid
ZoneId: cn-beijing-k
VSwitchId:
Ref: VSwitch
DBNodeClass: polar.pg.sl.small
SecurityIPList: 0.0.0.0/0
ServerlessType: AgileServerless
ScaleMin: 1
ScaleMax: 3
ScaleRoNumMin: 1
ScaleRoNumMax: 2
HotStandbyCluster: 'OFF'
{
"ROSTemplateFormatVersion": "2015-09-01",
"Resources": {
"VPC": {
"Type": "ALIYUN::ECS::VPC",
"Properties": {
"VpcName": "polardb-test",
"CidrBlock": "192.168.0.0/16"
}
},
"VSwitch": {
"Type": "ALIYUN::ECS::VSwitch",
"Properties": {
"VSwitchName": "polardb-test",
"VpcId": {
"Ref": "VPC"
},
"CidrBlock": "192.168.1.0/24",
"ZoneId": "cn-beijing-k"
}
},
"PolardbCluster": {
"Type": "ALIYUN::POLARDB::DBCluster",
"Properties": {
"VpcId": {
"Ref": "VPC"
},
"CreationCategory": "Normal",
"StorageType": "PSL5",
"DBType": "PostgreSQL",
"ClusterNetworkType": "VPC",
"DBVersion": "16",
"PayType": "Postpaid",
"ZoneId": "cn-beijing-k",
"VSwitchId": {
"Ref": "VSwitch"
},
"DBNodeClass": "polar.pg.sl.small",
"SecurityIPList": "0.0.0.0/0",
"ServerlessType": "AgileServerless",
"ScaleMin": 1,
"ScaleMax": 3,
"ScaleRoNumMin": 1,
"ScaleRoNumMax": 2,
"HotStandbyCluster": "OFF"
}
}
}
}For more examples that show how to create a PolarDB cluster, create a database account, create a database, add a node, grant a standard account permissions to access a database, modify the IP address whitelist, and create a public endpoint, see YAML examples.