全部產品
Search
文件中心

:ALIYUN::POLARDB::DBCluster

更新時間:Feb 06, 2026

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

資料庫引擎類型。

取值:

  • MySQL

  • PostgreSQL

  • Oracle

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

資料庫版本號碼。

取值:

  • MySQL 版本號碼取值範圍如下:

    • 5.6

    • 5.7

    • 8.0

  • PostgreSQL 版本號碼取值範圍如下:

    • 11

    • 14

    • 15

      說明

      PolarDB PostgreSQL 版中如需建立 Serverless 叢集,版本號碼只支援 14。

  • Oracle 版本號碼取值範圍如下:

    • 11

    • 14

PayType

String

付費類型。

取值:

  • Postpaid:隨用隨付。

  • Prepaid:預付費(訂用帳戶)。

AutoRenewPeriod

Integer

執行個體自動續約時間長度。

取值:

  • 1(預設值)

  • 2

  • 3

  • 6

  • 12

  • 24

  • 36

單位:月。

DBClusterDescription

String

叢集描述。

長度為2~256個字元。以英文字母或漢字開頭,不能以http://https://開頭。可包含英文字母、漢字、數字、半形逗號(,)和短劃線(-) 。

ClusterNetworkType

String

叢集網路類型。

當前僅支援專用網路,取值:VPC。

RenewalStatus

String

自動續約狀態。

取值:

  • AutoRenewal:自動續約。

  • Normal(預設值):手動續約。

  • NotRenewal:不再續約。

    說明

    設定為NotRenewal後,系統不再發送到期提醒,只在到期前第三天發送不續約提醒。

Period

Integer

預付費類型(即PayType為Prepaid時)執行個體的時間長度。

取值:

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 12

  • 24

  • 36

單位:月。

ZoneId

String

可用性區域ID。

您可以通過DescribeRegions介面查詢可選的可用性區域。

SourceResourceId

String

源RDS執行個體ID或源PolarDB叢集ID。

源 RDS 執行個體 ID 或源 PolarDB 叢集 ID。僅當 CreationOption 為 MigrationFromRDSCloneFromRDSCloneFromPolarDB 或 RecoverFromRecyclebin 時,該參數必填。

  • 若 CreationOption 為 MigrationFromRDS 或 CloneFromRDS,您需要為本參數傳入源 RDS 執行個體 ID。源 RDS 執行個體版本需為 RDS MySQL 5.6 、5.7 或 8.0 高可用版。

  • 若 CreationOption 為 CloneFromPolarDB,您需要為本參數傳入源 PolarDB 叢集 ID。複製叢集和源叢集的 DBType 預設保持一致。例如源叢集為 MySQL 8.0,則複製叢集也需設定 DBType 為 MySQL 且 DBVersion 為8.0

  • 若 CreationOption 為 RecoverFromRecyclebin,您需要為本參數傳入已釋放的源 PolarDB 叢集 ID。從資源回收筒恢複的叢集和源叢集的 DBType 需保持一致。例如源叢集為 MySQL 8.0,則從資源回收筒恢複的叢集也需設定 DBType 為 MySQL 且 DBVersion 為8.0

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

複製資料的時間節點。

取值:

  • LATEST(預設值):最新時間點的資料。

    說明

    當CreationOption取值為CloneFromRDS時,該參數取值為LATEST。

  • BackupID:歷史備份組ID。

  • Timestamp:記錄點,格式:yyyy-MM-ddTHH:mm:ssZ(UTC時間)。

說明

若 CreationOption 為 CloneFromRDS,則本參數取值只能為 LATEST

CreationCategory

String

叢集系列。

產品系列,取值範圍如下:

  • Normal:叢集版(預設值)

  • Basic:單節點

  • ArchiveNormal:高壓縮引擎(X-Engine)

  • NormalMultimaster:多主架構叢集版

  • SENormal:標準版

說明

MySQL 5.65.78.0PostgreSQL 14 以及 Oracle 文法相容 2.0 版支援 Basic

MySQL 8.0支援 ArchiveNormal 和 NormalMultimaster

MySQL 5.65.78.0和 PostgreSQL 14 支援 SENormal

BackupRetentionPolicyOnClusterDeletion

String

刪除叢集時備份組保留原則。

取值:

  • ALL:持續保留全部備份。

  • LATEST:持續保留最後一個備份(刪除前自動備份)。

  • NONE(預設值):叢集刪除時不保留備份組。

建立叢集時,預設取值為 NONE,即叢集刪除時不保留備份組。

說明
  • 僅當 DBType 為 MySQL 時,該參數生效。

  • Serverless 叢集不支援該參數。

ResourceGroupId

String

資源群組ID。

DefaultTimeZone

String

叢集時區(UTC)。

預設取值為SYSTEM,預設時區與Region所在時區一致。

可選取值範圍為-12:00~+13:00內的所有整數時間點,如 00:00。

說明

僅當DBType取值為MySQL時,該參數生效。

GDNId

String

全球資料庫網路ID。

當CreationOption取值為CreateGdnStandby時,該參數必填。

LowerCaseTableNames

Integer

表名是否區分大小寫。

取值:

  • 1(預設值):不區分大小寫。

  • 0:區分大小寫。

說明

僅當DBType為MySQL時,該參數生效。

DBClusterParameters

Map

PolarDB叢集的參數。

更多資訊,請參見DBClusterParameters屬性

DeletionProtection

Boolean

是否開啟刪除保護。

取值:

  • true:開啟刪除保護。

  • false(預設值):不開啟刪除保護。

TDEStatus

Boolean

是否開啟透明資料加密(TDE)。

取值:

  • true:開啟。

    說明

    TDE功能開啟後不可關閉。

  • false(預設值):關閉。

說明

當DBType取值為PostgreSQL或DBType取值為Oracle時,該參數生效。

PeriodUnit

String

時間長度單位。

取值:

  • Year:年。

  • Month:月。

ScaleRoNumMin

Integer

唯讀節點數的最小擴容和縮容限制。

取值範圍:0~15。

說明

僅 Serverless 叢集支援該參數。

ScaleMax

Integer

單節點擴容和縮容的最大限制。

取值範圍:1 PCU~32 PCU。

說明

僅 Serverless 叢集支援該參數。

AllowShutDown

Boolean

是否開啟無活動暫停。

取值:

  • true:開啟無活動暫停。

  • false:關閉無活動暫停。

說明

僅 Serverless 叢集支援該參數。

ServerlessType

String

Serverless服務類型。

取值:AgileServerless。

說明

僅 Serverless 叢集支援該參數。

ScaleRoNumMax

Integer

唯讀節點數的最大擴容和縮容限制。

取值範圍:0~15。

說明

僅 Serverless 叢集支援該參數。

ScaleMin

Integer

單節點擴容和縮容的最小限制。

取值範圍:1 PCU~31 PCU。

說明

僅 Serverless 叢集支援該參數。

SSLEnabled

String

修改SSL狀態。

取值:

  • Disable:禁用SSL加密。

  • Enable:啟用SSL加密。

  • Update:更新SSL認證。

StorageType

String

儲存類型。

企業版儲存類型取值如下:

  • PSL5

  • PSL4

標準版儲存類型取值如下:

  • ESSDPL0

  • ESSDPL1

  • ESSDPL2

  • ESSDPL3

  • ESSDAUTOPL

LooseXEngine

String

開啟X-Engine儲存引擎功能。

取值:

  • ON:叢集開啟X-Engine引擎

  • OFF:叢集關閉X-Engine引擎

說明

當參數CreationOption不等於CreateGdnStandbyDBTypeMySQLDBVersion8.0時,該參數才生效。開啟X-Engine引擎的節點記憶體規格必須大於等於16 GB。

LoosePolarLogBin

String

開啟Binlog功能。

取值:

  • ON:叢集開啟Binlog功能

  • OFF:叢集關閉Binlog功能

說明

當參數DBTypeMySQL時,該參數才生效。

StorageSpace

Integer

按空間計費(訂用帳戶)的儲存空間。

單位:GB。

說明
  • PolarDB MySQL 標準版儲存空間的取值範圍:20~32000。

  • 標準版儲存類型為 ESSDAUTOPL 時,儲存空間的取值範圍:40~64000,步長最小為 10,即只能填寫 40、50、60...以此類推。

ProxyType

String

資料庫代理類型。

取值範圍如下:

  • EXCLUSIVE:企業獨享版

  • GENERAL:企業通用版

說明

代理類型需要與叢集的節點規格對應的類型保持一致。即:

節點規格為通用規格,則代理類型應為企業通用版;

節點規格為獨享規格,則代理類型應為企業獨享版。

StandbyAZ

String

儲存熱備叢集的可用性區域。

適用於標準版3AZ情境。

說明

開啟了多可用性區域資料強一致,該參數才生效。

LooseXEngineUseMemoryPct

Integer

設定開啟X-Engine儲存引擎比例。

取值範圍10~90的整數。

說明

當參數LooseXEngineON時,該參數才生效。

StorageUpperBound

Integer

設定標準版叢集儲存自動擴容上限。

單位:GB。

說明

取值最大為32000。

StrictConsistency

String

叢集是否開啟了多可用性區域資料強一致。

取值:

  • ON:表示開啟了多可用性區域資料強一致,適用於標準版3AZ情境。

  • OFF:表示未開啟多可用性區域資料強一致。

StoragePayType

String

儲存計費類型。

取值:

  • Postpaid:按容量計費(隨用隨付)。

  • Prepaid:按空間計費(訂用帳戶)。

DBNodeNum

Integer

標準版和企業版節點個數。

取值如下:

  • 標準版取值範圍:1~8(支援 1 個讀寫節點和 7 個唯讀節點)。

  • 企業版取值範圍:1~16(支援 1 個讀寫節點和 15 個唯讀節點)。

說明
  • 企業版預設有 2 個節點,標準版預設有 1 個節點。

  • 僅 PolarDB MySQL 版支援該參數。

  • 目前暫不支援多主叢集節點數量變更設定。

ProxyClass

String

標準版資料庫代理規格。

取值:

  • polar.maxscale.g2.medium.c:2 核。

  • polar.maxscale.g2.large.c:4 核。

  • polar.maxscale.g2.xlarge.c:8 核。

  • polar.maxscale.g2.2xlarge.c:16 核。

  • polar.maxscale.g2.3xlarge.c:24 核。

  • polar.maxscale.g2.4xlarge.c:32 核。

  • polar.maxscale.g2.8xlarge.c:64 核。

HotStandbyCluster

String

是否開啟熱備叢集。

取值:

  • ON(預設):開啟熱備叢集。

  • OFF:關閉熱備叢集。

  • STANDBY:標準版開啟熱備叢集。

說明

標準版叢集的預設值為STANDBY

StorageAutoScale

String

標準版叢集是否開啟儲存自動擴容。

取值:

  • Enable:開啟儲存自動擴容。

  • Disable:關閉儲存自動擴容。

Architecture

String

CPU 架構。

取值:

  • X86

  • ARM

DBMinorVersion

String

資料庫引擎小版本號碼。

取值:

  • 8.0.2

  • 8.0.1

說明

當參數 DBType 為 MySQL 且 DBVersion 為8.0時,該參數才生效。

VpcId

String

專用網路ID。

ParameterGroupId

String

參數模板ID。

您可以通過DescribeParameterGroups介面查看目標地區的參數模板列表,包括參數模板ID。

RestartMasterNode

Boolean

是否重啟主節點。

取值:

  • true:重啟主節點。

  • false:不重啟主節點。

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個字元,不能以aliyunacs:開頭,不能包含http://或者https://

Value

String

標籤值。

長度為0~128個字元,不能以aliyunacs:開頭,不能包含http://或者https://

DBClusterParameters文法

"DBClusterParameters": {
  "Parameters": String,
  "EffectiveTime": String
}

DBClusterParameters屬性

屬性名稱

類型

必須

允許更新

描述

約束

Parameters

String

參數及其值的JSON字串。

參數的值都是字串類型。

EffectiveTime

String

參數的生效時間。

取值:

  • Auto:自動確定何時生效。

  • Immediately:立即生效。

  • MaintainTime:叢集維護期間生效。

ColdStorageOption文法

"ColdStorageOption": {
  "Description": String,
  "Enable": Boolean
}

ColdStorageOption屬性

屬性名稱

類型

必須

允許更新

描述

約束

Description

String

描述資訊。

如果設定了描述資訊,則表示開啟了冷資料歸檔功能。 長度不超過256個字元。 

Enable

Boolean

開啟冷資料歸檔功能。

取值:

  • true

  • false

傳回值

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"
      ]
    }
  }
}

更多樣本,請參考包含此資源的公用模板