ALIYUN::POLARDB::DBCluster類型用於建立PolarDB叢集。
文法
{
"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
}
}屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
DBType | String | 是 | 否 | 資料庫引擎類型。 | 取值:
|
DBNodeClass | String | 是 | 否 | 節點規格。 | 節點規格,詳情請參見如下文檔: 說明 PolarDB MySQL 叢集版中如需建立 Serverless 叢集,請傳入polar.mysql.sl.small。 PolarDB MySQL 標準版如需建立 Serverless 叢集,請傳入polar.mysql.sl.small.c。 PolarDB PostgreSQL 版(相容 Oracle)和 PolarDB PostgreSQL 版中如需建立 Serverless 叢集,請傳入polar.pg.sl.small.c。 |
DBVersion | String | 是 | 否 | 資料庫版本號碼。 | 取值:
|
PayType | String | 是 | 是 | 付費類型。 | 取值:
|
AutoRenewPeriod | Integer | 否 | 是 | 執行個體自動續約時間長度。 | 取值:
單位:月。 |
DBClusterDescription | String | 否 | 是 | 叢集描述。 | 長度為2~256個字元。以英文字母或漢字開頭,不能以 |
ClusterNetworkType | String | 否 | 否 | 叢集網路類型。 | 當前僅支援專用網路,取值:VPC。 |
RenewalStatus | String | 否 | 是 | 自動續約狀態。 | 取值:
|
Period | Integer | 否 | 是 | 預付費類型(即PayType為Prepaid時)執行個體的時間長度。 | 取值:
單位:月。 |
ZoneId | String | 否 | 否 | 可用性區域ID。 | 您可以通過DescribeRegions介面查詢可選的可用性區域。 |
SourceResourceId | String | 否 | 否 | 源RDS執行個體ID或源PolarDB叢集ID。 | 源 RDS 執行個體 ID 或源 PolarDB 叢集 ID。僅當 CreationOption 為 MigrationFromRDS、CloneFromRDS、CloneFromPolarDB 或 RecoverFromRecyclebin 時,該參數必填。
|
SecurityGroupIds | List | 否 | 是 | 安全性群組ID列表。 | 最多支援3個安全性群組。 |
Tags | List | 否 | 是 | 標籤。 | 最多支援添加20個標籤。 更多資訊,請參見Tags屬性。 |
MaintainTime | String | 否 | 是 | 叢集的可維護時間。 | 格式:HH:mmZ-HH:mmZ。例如:16:00Z-17:00Z,表示0點到1點(UTC+08:00)可進行例行維護。 |
CreationOption | String | 否 | 否 | 建立方式。 | 建立方式,取值範圍如下:
預設為 Normal。 說明 當 DBType 為 MySQL 且 DBVersion 為8.0時,本參數取值可以為 CreateGdnStandby。 |
VSwitchId | String | 否 | 否 | 交換器ID。 | 無 |
SecurityIPList | String | 否 | 否 | PolarDB叢集白名單。 | 說明 支援配置多個白名單 IP 位址,多個 IP 位址之間使用英文逗號分隔。 |
CloneDataPoint | String | 否 | 否 | 複製資料的時間節點。 | 取值:
說明 若 CreationOption 為 CloneFromRDS,則本參數取值只能為 LATEST。 |
CreationCategory | String | 否 | 否 | 叢集系列。 | 產品系列,取值範圍如下:
說明 MySQL 5.6、5.7、8.0,PostgreSQL 14 以及 Oracle 文法相容 2.0 版支援 Basic。 MySQL 8.0支援 ArchiveNormal 和 NormalMultimaster。 MySQL 5.6、5.7、8.0和 PostgreSQL 14 支援 SENormal。 |
BackupRetentionPolicyOnClusterDeletion | String | 否 | 否 | 刪除叢集時備份組保留原則。 | 取值:
建立叢集時,預設取值為 NONE,即叢集刪除時不保留備份組。 說明
|
ResourceGroupId | String | 否 | 是 | 資源群組ID。 | 無 |
DefaultTimeZone | String | 否 | 否 | 叢集時區(UTC)。 | 預設取值為SYSTEM,預設時區與Region所在時區一致。 可選取值範圍為-12:00~+13:00內的所有整數時間點,如 00:00。 說明 僅當DBType取值為MySQL時,該參數生效。 |
GDNId | String | 否 | 否 | 全球資料庫網路ID。 | 當CreationOption取值為CreateGdnStandby時,該參數必填。 |
LowerCaseTableNames | Integer | 否 | 否 | 表名是否區分大小寫。 | 取值:
說明 僅當DBType為MySQL時,該參數生效。 |
DBClusterParameters | Map | 否 | 是 | PolarDB叢集的參數。 | 更多資訊,請參見DBClusterParameters屬性。 |
DeletionProtection | Boolean | 否 | 是 | 是否開啟刪除保護。 | 取值:
|
TDEStatus | Boolean | 否 | 是 | 是否開啟透明資料加密(TDE)。 | 取值:
說明 當DBType取值為PostgreSQL或DBType取值為Oracle時,該參數生效。 |
PeriodUnit | String | 否 | 是 | 時間長度單位。 | 取值:
|
ScaleRoNumMin | Integer | 否 | 否 | 唯讀節點數的最小擴容和縮容限制。 | 取值範圍:0~15。 說明 僅 Serverless 叢集支援該參數。 |
ScaleMax | Integer | 否 | 否 | 單節點擴容和縮容的最大限制。 | 取值範圍:1 PCU~32 PCU。 說明 僅 Serverless 叢集支援該參數。 |
AllowShutDown | Boolean | 否 | 否 | 是否開啟無活動暫停。 | 取值:
說明 僅 Serverless 叢集支援該參數。 |
ServerlessType | String | 否 | 否 | Serverless服務類型。 | 取值:AgileServerless。 說明 僅 Serverless 叢集支援該參數。 |
ScaleRoNumMax | Integer | 否 | 否 | 唯讀節點數的最大擴容和縮容限制。 | 取值範圍:0~15。 說明 僅 Serverless 叢集支援該參數。 |
ScaleMin | Integer | 否 | 否 | 單節點擴容和縮容的最小限制。 | 取值範圍:1 PCU~31 PCU。 說明 僅 Serverless 叢集支援該參數。 |
SSLEnabled | String | 否 | 是 | 修改SSL狀態。 | 取值:
|
StorageType | String | 否 | 否 | 儲存類型。 | 企業版儲存類型取值如下:
標準版儲存類型取值如下:
|
LooseXEngine | String | 否 | 否 | 開啟X-Engine儲存引擎功能。 | 取值:
說明 當參數CreationOption不等於CreateGdnStandby,DBType為MySQL且DBVersion為8.0時,該參數才生效。開啟X-Engine引擎的節點記憶體規格必須大於等於16 GB。 |
LoosePolarLogBin | String | 否 | 否 | 開啟Binlog功能。 | 取值:
說明 當參數DBType為MySQL時,該參數才生效。 |
StorageSpace | Integer | 否 | 否 | 按空間計費(訂用帳戶)的儲存空間。 | 單位:GB。 說明
|
ProxyType | String | 否 | 否 | 資料庫代理類型。 | 取值範圍如下:
說明 代理類型需要與叢集的節點規格對應的類型保持一致。即: 節點規格為通用規格,則代理類型應為企業通用版; 節點規格為獨享規格,則代理類型應為企業獨享版。 |
StandbyAZ | String | 否 | 否 | 儲存熱備叢集的可用性區域。 | 適用於標準版3AZ情境。 說明 開啟了多可用性區域資料強一致,該參數才生效。 |
LooseXEngineUseMemoryPct | Integer | 否 | 否 | 設定開啟X-Engine儲存引擎比例。 | 取值範圍10~90的整數。 說明 當參數LooseXEngine為ON時,該參數才生效。 |
StorageUpperBound | Integer | 否 | 否 | 設定標準版叢集儲存自動擴容上限。 | 單位:GB。 說明 取值最大為32000。 |
StrictConsistency | String | 否 | 否 | 叢集是否開啟了多可用性區域資料強一致。 | 取值:
|
StoragePayType | String | 否 | 否 | 儲存計費類型。 | 取值:
|
DBNodeNum | Integer | 否 | 否 | 標準版和企業版節點個數。 | 取值如下:
說明
|
ProxyClass | String | 否 | 否 | 標準版資料庫代理規格。 | 取值:
|
HotStandbyCluster | String | 否 | 否 | 是否開啟熱備叢集。 | 取值:
說明 標準版叢集的預設值為STANDBY。 |
StorageAutoScale | String | 否 | 否 | 標準版叢集是否開啟儲存自動擴容。 | 取值:
|
Architecture | String | 否 | 否 | CPU 架構。 | 取值:
|
DBMinorVersion | String | 否 | 否 | 資料庫引擎小版本號碼。 | 取值:
說明 當參數 DBType 為 MySQL 且 DBVersion 為8.0時,該參數才生效。 |
VpcId | String | 否 | 否 | 專用網路ID。 | 無 |
ParameterGroupId | String | 否 | 否 | 參數模板ID。 | 您可以通過DescribeParameterGroups介面查看目標地區的參數模板列表,包括參數模板ID。 |
RestartMasterNode | Boolean | 否 | 否 | 是否重啟主節點。 | 取值:
|
ColdStorageOption | Map | 否 | 否 | 冷資料歸檔選項。 | 更多資訊,請參見ColdStorageOption屬性。 |
ProvisionedIops | Integer | 否 | 否 | ESSD AutoPL 雲端硬碟預配置的讀寫 IOPS。 | 可能值:0~min{50,000, 1000*容量-基準效能}。 基準效能=min{1,800+50*容量, 50000}。 說明 當 StorageType 為 ESSDAUTOPL 時才支援該參數。 |
Tags文法
"Tags": [
{
"Key": String,
"Value": String
}
] Tags屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
Key | String | 是 | 否 | 標籤鍵。 | 長度為1~128個字元,不能以 |
Value | String | 否 | 否 | 標籤值。 | 長度為0~128個字元,不能以 |
DBClusterParameters文法
"DBClusterParameters": {
"Parameters": String,
"EffectiveTime": String
}DBClusterParameters屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
Parameters | String | 否 | 是 | 參數及其值的JSON字串。 | 參數的值都是字串類型。 |
EffectiveTime | String | 否 | 是 | 參數的生效時間。 | 取值:
|
ColdStorageOption文法
"ColdStorageOption": {
"Description": String,
"Enable": Boolean
}ColdStorageOption屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
Description | String | 否 | 否 | 描述資訊。 | 如果設定了描述資訊,則表示開啟了冷資料歸檔功能。 長度不超過256個字元。 |
Enable | Boolean | 否 | 否 | 開啟冷資料歸檔功能。 | 取值:
|
傳回值
Fn::GetAtt
DBClusterId:叢集ID。
OrderId:訂單ID。
DBNodeIds:叢集節點ID。
PrimaryEndpointId:主地址ID。
CustomEndpointIds:自訂叢集地址ID。
CustomConnectionStrings:自訂串連串。
PrimaryConnectionString:主串連串。
ClusterConnectionString:自訂串連串。
ClusterEndpointId:叢集地址ID。
PrimaryEndpointIds:叢集主地址ID列表。
PrimaryConnectionStrings:叢集主地址串連串列表。
ColdStorageInstanceId:冷資料庫執行個體ID。
DBClusterDescription:叢集描述。
Arn:阿里雲資源名稱。
樣本
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: 現有Virtual Private Cloud絡的執行個體ID
Label:
en: VPC ID
zh-cn: Virtual Private Cloud執行個體ID
VSwitchZoneId:
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
Type: String
Description:
zh-cn: 交換器可用性區域
en: VSwitch Availability Zone
Label:
zh-cn: 交換器可用性區域
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: 現有業務網路交換器的執行個體ID
Label:
en: VSwitch ID
zh-cn: 交換器執行個體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",
"zh-cn": "現有Virtual Private Cloud絡的執行個體ID"
},
"Label": {
"en": "VPC ID",
"zh-cn": "Virtual Private Cloud執行個體ID"
}
},
"VSwitchZoneId": {
"AssociationProperty": "ALIYUN::ECS::Instance:ZoneId",
"Type": "String",
"Description": {
"zh-cn": "交換器可用性區域",
"en": "VSwitch Availability Zone"
},
"Label": {
"zh-cn": "交換器可用性區域",
"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": "現有業務網路交換器的執行個體ID"
},
"Label": {
"en": "VSwitch ID",
"zh-cn": "交換器執行個體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"
]
}
}
}
}PolarDB PostgreSQL Serverless樣本
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"
}
}
}
}更多樣本,請參見建立PolarDB叢集、為PolarDB資料庫建立帳號、在PolarDB叢集下建立一個新的資料庫、增加PolarDB叢集節點、授權普通帳號訪問PolarDB叢集的某個資料庫、修改允許訪問資料庫叢集的IP名單和建立PolarDB叢集的公網地址的組合樣本:YAML樣本。