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
}
}
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, 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:
|
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. | Default value: Normal. Valid values:
|
AutoRenewPeriod | Integer | No | Yes | The auto-renewal period of the cluster. | Default value: 1. Valid values:
Unit: months. |
Period | Integer | No | No | The subscription duration of the cluster. | Valid values:
Unit: months. |
ZoneId | String | No | No | The ID of the zone. | You can call the DescribeRegions operation to query the zone ID. |
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 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 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:
|
CreationOption | String | No | No | The method that you want use to create the cluster. | Default value: Normal. Valid values:
|
DBNodeClass | String | Yes | No | The specifications of the node. |
For more information, see Billable items. |
VSwitchId | String | No | No | The ID of the vSwitch. | 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. | Default value: LATEST. Valid values:
|
PayType | String | Yes | No | The billing method of the cluster. | Valid values:
|
CreationCategory | String | No | No | The edition of the cluster. | Set the value to Normal, which specifies Cluster Edition. |
BackupRetentionPolicyOnClusterDeletion | String | No | No | The retention policy for the backup sets when you delete the cluster. | Default value: NONE. Valid values:
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. |
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 based on UTC. Example: 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 the table names are case-sensitive. | Default value: 1. Valid values:
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 property. |
TDEStatus | Boolean | No | Yes | Specifies whether to enable transparent data encryption (TDE). | Default value: false. Valid values:
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:
|
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 No-activity Suspension. | Valid values:
|
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. |
Tags syntax
"Tags": [
{
"Key": String,
"Value": String
}
]
Tags properties
Property | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
Key | String | Yes | No | The key of the tag. | The key must be 1 to 128 characters in length. The key cannot contain http:// or https:// . The key cannot start with aliyun or acs: .
|
Value | String | No | No | The value of the tag. | The value can be up to 128 characters in length. The value cannot contain http:// or https:// . The 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:
|
Return values
Fn::GetAtt
- DBClusterId: the ID of the cluster.
- OrderId: the order ID of the cluster.
- DBNodeIds: the IDs of the nodes in the cluster.
- PrimaryEndpointId: the ID of the primary endpoint.
- 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 ID of the cluster endpoint.
Examples
-
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", }, "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.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.