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:阿里雲資源名稱。
樣本
情境 1 :建立MySQL類型的PolarDB叢集。
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"
]
}
}
}
}情境 2 :建立PostgreSQL類型的PolarDB叢集。
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"
}
}
}
}情境 3 :建立原生 SQL 輕鬆實現多模態智能檢索。
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 原生 SQL 輕鬆實現多模態智能檢索。
en: Native SQL easily realizes multimodal intelligent retrieval.
Parameters:
CommonName:
Type: String
Default: SmartSearch
BucketName:
AssociationProperty: AutoCompleteInput
AssociationPropertyMetadata:
Length: 6
Prefix: test-bucket-
CharacterClasses:
- Class: lowercase
min: 1
Type: String
Label:
zh-cn: Bucket名稱
en: Bucket Name
ZoneId:
Type: String
Label:
zh-cn: 可用性區域ID
en: Available Zone ID
AssociationProperty: ALIYUN::ECS::Instance::ZoneId
AccountName:
Type: String
Label:
zh-cn: 資料庫使用者名稱
en: Account Name
Description:
zh-cn: 長度不超過16個字元。以小寫英文字母開頭,可包含小寫英文字母、數字和底線(_)。
en: The length should not exceed 16 characters. It begins with a lowercase English letter and can contain lowercase English letters, numbers and underscores (_).
ConstraintDescription:
zh-cn: 長度不超過16個字元。以小寫英文字母開頭,可包含小寫英文字母、數字和底線(_)。
en: The length should not exceed 16 characters. It begins with a lowercase English letter and can contain lowercase English letters, numbers and underscores (_).
AllowedPattern: '^[a-z][a-z0-9_]{0,30}[a-z0-9]$'
Default: polar_ai
MaxLength: 16
MinLength: 2
AccountPassword:
Type: String
Description:
en: Server login password, Length 8-32, must contain three(Capital letters, lowercase letters, numbers, !@#$%^&*()_+-= Special symbol in)
zh-cn: 資料庫訪問密碼,長度8-32,必須包含三項(大寫字母、小寫字母、數字、 !@#$%^&*()_+-= 中的特殊符號)
Label:
en: Account Password
zh-cn: 資料庫密碼
ConstraintDescription:
en: Length 8-32, must contain three(Capital letters, lowercase letters, numbers, !@#$%^&*()_+-=Special symbol in)
zh-cn: 長度8-32,必須包含三項(大寫字母、小寫字母、數字、 !@#$%^&*()_+-=中的特殊符號)
AllowedPattern: '^[0-9A-Za-z_!@#$%^&*()_+\-=\+]+$'
MinLength: 8
MaxLength: 32
NoEcho: true
DBName:
Type: String
Label:
en: Database Name
zh-cn: 資料庫名稱
AllowedPattern: ^[a-z][a-z0-9_-]{0,62}[a-z0-9]$
Description:
en: It is composed of lowercase letters, numbers, an underscore (-), and an underscore (_), ending with a lowercase letter or number, beginning with a letter, and ending with a letter or number, with a maximum of 64 characters.
zh-cn: 由小寫字母、數字、中劃線(-)、底線(_)組成,小寫字母或數字結尾,以字母開頭,以字母或數字結尾,最長 64 個字元。
ConstraintDescription:
en: It is composed of lowercase letters, numbers, an underscore (-), and an underscore (_), ending with a lowercase letter or number, beginning with a letter, and ending with a letter or number, with a maximum of 64 characters.
zh-cn: 由小寫字母、數字、中劃線(-)、底線(_)組成,小寫字母或數字結尾,以字母開頭,以字母或數字結尾,最長 64 個字元。
Default: db-test
PolarDBNodeClass:
Type: String
Label:
en: PolarDB Node Specifications
zh-cn: 規格和代理
AssociationProperty: ALIYUN::POLARDB::DBCluster::DBNodeClass
AssociationPropertyMetadata:
ZoneId: ${ZoneId}
DBVersion: "14"
DBType: PostgreSQL
PayType: Postpaid
CommodityCode: polardb_payg
Default: polar.pg.g2.2xlarge.c
Resources:
VPC:
Type: ALIYUN::ECS::VPC
Properties:
VpcName:
Fn::Sub: VPC_${CommonName}
CidrBlock: 192.168.0.0/16
VSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
VpcId:
Ref: VPC
CidrBlock: 192.168.1.0/24
ZoneId:
Ref: ZoneId
VSwitchName:
Fn::Sub: vsw_001_${CommonName}
PolardbCluster:
Type: ALIYUN::POLARDB::DBCluster
Properties:
VpcId:
Ref: VPC
SecurityIPList: 0.0.0.0/0
DBType: PostgreSQL
ClusterNetworkType: VPC
ZoneId:
Ref: ZoneId
VSwitchId:
Ref: VSwitch
DBVersion: "14"
CreationCategory: SENormal
StorageSpace: 20
HotStandbyCluster: 'OFF'
DBNodeClass:
Ref: PolarDBNodeClass
PayType: Postpaid
DBNodeNum: 2
StorageType: ESSDPL1
Account:
Type: ALIYUN::POLARDB::Account
Properties:
DBClusterId:
Ref: PolardbCluster
AccountName:
Ref: AccountName
AccountPassword:
Ref: AccountPassword
AccountType: Super
Database:
DependsOn: Account
Type: ALIYUN::POLARDB::Database
Properties:
CharacterSetName: utf8
AccountPrivilege: ReadWrite
AccountName:
Ref: AccountName
DBClusterId:
Ref: PolardbCluster
DBName:
Ref: DBName
Collate: C
Ctype: C
DBClusterEndpointAddress:
Type: ALIYUN::POLARDB::DBClusterEndpointAddress
DependsOn: Account
Properties:
DBClusterId:
Ref: PolardbCluster
DBEndpointId:
Fn::GetAtt:
- PolardbCluster
- ClusterEndpointId
OSSBucket:
Type: ALIYUN::OSS::Bucket
Properties:
BucketName:
Ref: BucketName
DeletionForce: true
RedundancyType: ZRS
Outputs:
BucketName:
Description:
en: OSS Bucket Name.
zh-cn: Object Storage Service儲存桶名。
Value:
Ref: BucketName
AccountName:
Description:
en: PolarDB account name.
zh-cn: PolarDB 資料庫使用者名稱。
Value:
Ref: AccountName
AccountPassword:
NoEcho: true
Description:
en: PolarDB account password.
zh-cn: PolarDB 資料庫密碼。
Value:
Ref: AccountPassword
DBName:
Description:
en: PolarDB database name.
zh-cn: PolarDB 資料庫名稱。
Value:
Ref: DBName
ConnectionString:
Description:
en: PolarDB database connection string.
zh-cn: PolarDB 資料庫的公網地址。
Value:
Fn::Sub: ${DBClusterEndpointAddress.ConnectionString}:5432
Metadata:
ALIYUN::ROS::Interface:
Outputs:
- BucketName
- AccountName
- AccountPassword
- DBName
- ConnectionString
ParameterGroups:
- Parameters:
- ZoneId
Label:
default:
en: Network Configuration
zh-cn: 網路基礎配置
- Parameters:
- BucketName
Label:
default:
en: OSS Configuration
zh-cn: OSS 礎配置
- Parameters:
- PolarDBNodeClass
- DBName
- AccountName
- AccountPassword
Label:
default:
en: PolarDB PostgreSQL Configuration
zh-cn: 雲資料庫 PolarDB PostgreSQL 配置
TemplateTags:
- acs:technical-solution:internet-application-development:原生 SQL 輕鬆實現多模態智能檢索-tech_solu_262
Hidden:
- CommonName{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "原生 SQL 輕鬆實現多模態智能檢索。",
"en": "Native SQL easily realizes multimodal intelligent retrieval."
},
"Parameters": {
"CommonName": {
"Type": "String",
"Default": "SmartSearch"
},
"BucketName": {
"AssociationProperty": "AutoCompleteInput",
"AssociationPropertyMetadata": {
"Length": 6,
"Prefix": "test-bucket-",
"CharacterClasses": [
{
"Class": "lowercase",
"min": 1
}
]
},
"Type": "String",
"Label": {
"zh-cn": "Bucket名稱",
"en": "Bucket Name"
}
},
"ZoneId": {
"Type": "String",
"Label": {
"zh-cn": "可用性區域ID",
"en": "Available Zone ID"
},
"AssociationProperty": "ALIYUN::ECS::Instance::ZoneId"
},
"AccountName": {
"Type": "String",
"Label": {
"zh-cn": "資料庫使用者名稱",
"en": "Account Name"
},
"Description": {
"zh-cn": "長度不超過16個字元。以小寫英文字母開頭,可包含小寫英文字母、數字和底線(_)。",
"en": "The length should not exceed 16 characters. It begins with a lowercase English letter and can contain lowercase English letters, numbers and underscores (_)."
},
"ConstraintDescription": {
"zh-cn": "長度不超過16個字元。以小寫英文字母開頭,可包含小寫英文字母、數字和底線(_)。",
"en": "The length should not exceed 16 characters. It begins with a lowercase English letter and can contain lowercase English letters, numbers and underscores (_)."
},
"AllowedPattern": "^[a-z][a-z0-9_]{0,30}[a-z0-9]$",
"Default": "polar_ai",
"MaxLength": 16,
"MinLength": 2
},
"AccountPassword": {
"Type": "String",
"Description": {
"en": "Server login password, Length 8-32, must contain three(Capital letters, lowercase letters, numbers, !@#$%^&*()_+-= Special symbol in)",
"zh-cn": "資料庫訪問密碼,長度8-32,必須包含三項(大寫字母、小寫字母、數字、 !@#$%^&*()_+-= 中的特殊符號)"
},
"Label": {
"en": "Account Password",
"zh-cn": "資料庫密碼"
},
"ConstraintDescription": {
"en": "Length 8-32, must contain three(Capital letters, lowercase letters, numbers, !@#$%^&*()_+-=Special symbol in)",
"zh-cn": "長度8-32,必須包含三項(大寫字母、小寫字母、數字、 !@#$%^&*()_+-=中的特殊符號)"
},
"AllowedPattern": "^[0-9A-Za-z_!@#$%^&*()_+\\-=\\+]+$",
"MinLength": 8,
"MaxLength": 32,
"NoEcho": true
},
"DBName": {
"Type": "String",
"Label": {
"en": "Database Name",
"zh-cn": "資料庫名稱"
},
"AllowedPattern": "^[a-z][a-z0-9_-]{0,62}[a-z0-9]$",
"Description": {
"en": "It is composed of lowercase letters, numbers, an underscore (-), and an underscore (_), ending with a lowercase letter or number, beginning with a letter, and ending with a letter or number, with a maximum of 64 characters.",
"zh-cn": "由小寫字母、數字、中劃線(-)、底線(_)組成,小寫字母或數字結尾,以字母開頭,以字母或數字結尾,最長 64 個字元。"
},
"ConstraintDescription": {
"en": "It is composed of lowercase letters, numbers, an underscore (-), and an underscore (_), ending with a lowercase letter or number, beginning with a letter, and ending with a letter or number, with a maximum of 64 characters.",
"zh-cn": "由小寫字母、數字、中劃線(-)、底線(_)組成,小寫字母或數字結尾,以字母開頭,以字母或數字結尾,最長 64 個字元。"
},
"Default": "db-test"
},
"PolarDBNodeClass": {
"Type": "String",
"Label": {
"en": "PolarDB Node Specifications",
"zh-cn": "規格和代理"
},
"AssociationProperty": "ALIYUN::POLARDB::DBCluster::DBNodeClass",
"AssociationPropertyMetadata": {
"ZoneId": "${ZoneId}",
"DBVersion": "14",
"DBType": "PostgreSQL",
"PayType": "Postpaid",
"CommodityCode": "polardb_payg"
},
"Default": "polar.pg.g2.2xlarge.c"
}
},
"Resources": {
"VPC": {
"Type": "ALIYUN::ECS::VPC",
"Properties": {
"VpcName": {
"Fn::Sub": "VPC_${CommonName}"
},
"CidrBlock": "192.168.0.0/16"
}
},
"VSwitch": {
"Type": "ALIYUN::ECS::VSwitch",
"Properties": {
"VpcId": {
"Ref": "VPC"
},
"CidrBlock": "192.168.1.0/24",
"ZoneId": {
"Ref": "ZoneId"
},
"VSwitchName": {
"Fn::Sub": "vsw_001_${CommonName}"
}
}
},
"PolardbCluster": {
"Type": "ALIYUN::POLARDB::DBCluster",
"Properties": {
"VpcId": {
"Ref": "VPC"
},
"SecurityIPList": "0.0.0.0/0",
"DBType": "PostgreSQL",
"ClusterNetworkType": "VPC",
"ZoneId": {
"Ref": "ZoneId"
},
"VSwitchId": {
"Ref": "VSwitch"
},
"DBVersion": "14",
"CreationCategory": "SENormal",
"StorageSpace": 20,
"HotStandbyCluster": "OFF",
"DBNodeClass": {
"Ref": "PolarDBNodeClass"
},
"PayType": "Postpaid",
"DBNodeNum": 2,
"StorageType": "ESSDPL1"
}
},
"Account": {
"Type": "ALIYUN::POLARDB::Account",
"Properties": {
"DBClusterId": {
"Ref": "PolardbCluster"
},
"AccountName": {
"Ref": "AccountName"
},
"AccountPassword": {
"Ref": "AccountPassword"
},
"AccountType": "Super"
}
},
"Database": {
"DependsOn": "Account",
"Type": "ALIYUN::POLARDB::Database",
"Properties": {
"CharacterSetName": "utf8",
"AccountPrivilege": "ReadWrite",
"AccountName": {
"Ref": "AccountName"
},
"DBClusterId": {
"Ref": "PolardbCluster"
},
"DBName": {
"Ref": "DBName"
},
"Collate": "C",
"Ctype": "C"
}
},
"DBClusterEndpointAddress": {
"Type": "ALIYUN::POLARDB::DBClusterEndpointAddress",
"DependsOn": "Account",
"Properties": {
"DBClusterId": {
"Ref": "PolardbCluster"
},
"DBEndpointId": {
"Fn::GetAtt": [
"PolardbCluster",
"ClusterEndpointId"
]
}
}
},
"OSSBucket": {
"Type": "ALIYUN::OSS::Bucket",
"Properties": {
"BucketName": {
"Ref": "BucketName"
},
"DeletionForce": true,
"RedundancyType": "ZRS"
}
}
},
"Outputs": {
"BucketName": {
"Description": {
"en": "OSS Bucket Name.",
"zh-cn": "Object Storage Service儲存桶名。"
},
"Value": {
"Ref": "BucketName"
}
},
"AccountName": {
"Description": {
"en": "PolarDB account name.",
"zh-cn": "PolarDB 資料庫使用者名稱。"
},
"Value": {
"Ref": "AccountName"
}
},
"AccountPassword": {
"NoEcho": true,
"Description": {
"en": "PolarDB account password.",
"zh-cn": "PolarDB 資料庫密碼。"
},
"Value": {
"Ref": "AccountPassword"
}
},
"DBName": {
"Description": {
"en": "PolarDB database name.",
"zh-cn": "PolarDB 資料庫名稱。"
},
"Value": {
"Ref": "DBName"
}
},
"ConnectionString": {
"Description": {
"en": "PolarDB database connection string.",
"zh-cn": "PolarDB 資料庫的公網地址。"
},
"Value": {
"Fn::Sub": "${DBClusterEndpointAddress.ConnectionString}:5432"
}
}
},
"Metadata": {
"ALIYUN::ROS::Interface": {
"Outputs": [
"BucketName",
"AccountName",
"AccountPassword",
"DBName",
"ConnectionString"
],
"ParameterGroups": [
{
"Parameters": [
"ZoneId"
],
"Label": {
"default": {
"en": "Network Configuration",
"zh-cn": "網路基礎配置"
}
}
},
{
"Parameters": [
"BucketName"
],
"Label": {
"default": {
"en": "OSS Configuration",
"zh-cn": "OSS 礎配置"
}
}
},
{
"Parameters": [
"PolarDBNodeClass",
"DBName",
"AccountName",
"AccountPassword"
],
"Label": {
"default": {
"en": "PolarDB PostgreSQL Configuration",
"zh-cn": "雲資料庫 PolarDB PostgreSQL 配置"
}
}
}
],
"TemplateTags": [
"acs:technical-solution:internet-application-development:原生 SQL 輕鬆實現多模態智能檢索-tech_solu_262"
],
"Hidden": [
"CommonName"
]
}
}
}更多樣本,請參考包含此資源的公用模板。