すべてのプロダクト
Search
ドキュメントセンター

Resource Orchestration Service:ALIYUN::POLARDB::DBCluster

最終更新日:Feb 07, 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 for MySQL Cluster Edition で Serverless クラスターを作成する場合、このパラメーターを polar.mysql.sl.small に設定します。

PolarDB for MySQL Standard Edition で Serverless クラスターを作成する場合、このパラメーターを polar.mysql.sl.small.c に設定します。

PolarDB for PostgreSQL(Oracle 互換)または PolarDB for PostgreSQL で Serverless クラスターを作成する場合、このパラメーターを polar.pg.sl.small.c に設定します。

DBVersion

String

はい

いいえ

データベースのバージョンです。

有効な値:

  • MySQL のバージョン番号の有効範囲は以下のとおりです。

    • 5.6

    • 5.7

    • 8.0

  • PostgreSQL のバージョン番号の有効範囲は以下のとおりです。

    • 11

    • 14

    • 15

      説明

      PolarDB for PostgreSQL でサーバーレスクラスターを作成する場合、サポートされるのはバージョン 14 のみです。

  • Oracle のバージョン番号は以下の範囲内である必要があります。

    • 11

    • 14

PayType

String

はい

はい

課金方法です。

有効な値:

  • 後払い: 従量課金。

  • Prepaid:サブスクリプション

AutoRenewPeriod

Integer

いいえ

はい

インスタンスの自動更新期間です。

有効な値:

  • 1(デフォルト)

  • 2

  • 3

  • 6

  • 12

  • 24

  • 36

単位:月。

DBClusterDescription

String

いいえ

はい

クラスターの説明です。

説明は 2 文字以上 256 文字以内で、英字または漢字で始める必要があります。また、http:// または https:// で始めてはいけません。英字、漢字、数字、カンマ(,)、ハイフン(-)を含めることができます。

ClusterNetworkType

String

いいえ

いいえ

クラスターのネットワークタイプです。

VPC のみがサポートされています。有効な値:VPC。

RenewalStatus

String

いいえ

はい

自動更新ステータスです。

有効な値:

  • AutoRenewal:自動更新が有効です。

  • Normal(デフォルト):手動更新です。

  • NotRenewal:自動更新が無効です。

    説明

    このパラメーターを NotRenewal に設定した場合、システムは有効期限のリマインダー送信を停止し、有効期限の 3 日前に 1 回のみリマインダーを送信します。

Period

Integer

いいえ

はい

サブスクリプション期間です。このパラメーターは、PayType が Prepaid に設定されている場合にのみ有効です。

有効な値:

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 12

  • 24

  • 36

単位:月。

ZoneId

String

いいえ

いいえ

ゾーン ID です。

利用可能なゾーンを照会するには、DescribeRegions 操作を呼び出します。

SourceResourceId

String

いいえ

いいえ

ソース RDS インスタンスまたはソース PolarDB クラスターの ID です。

ソース RDS インスタンスまたはソース PolarDB クラスターの ID です。このパラメーターは、CreationOptionMigrationFromRDSCloneFromRDSCloneFromPolarDB、または RecoverFromRecyclebin に設定されている場合にのみ必須です。

  • CreationOptionMigrationFromRDS または CloneFromRDS に設定されている場合、ソース RDS インスタンスの ID を指定します。ソース RDS インスタンスは、RDS for MySQL 5.6、5.7、または 8.0 High-availability Edition を実行している必要があります。

  • CreationOptionCloneFromPolarDB に設定されている場合、ソース PolarDB クラスターの ID を指定します。クローン作成されたクラスターの DBType は、デフォルトでソースクラスターと同じになります。たとえば、ソースクラスターが MySQL 8.0 を実行している場合、クローン作成されたクラスターでは DBTypeMySQLDBVersion8.0 に設定します。

  • CreationOptionRecoverFromRecyclebin に設定されている場合、リリース済みのソース PolarDB クラスターの ID を指定します。回復されたクラスターの DBType は、ソースクラスターと同じである必要があります。たとえば、ソースクラスターが MySQL 8.0 を実行している場合、回復されたクラスターでは DBTypeMySQLDBVersion8.0 に設定します。

SecurityGroupIds

List

いいえ

はい

セキュリティグループ ID のリストです。

最大 3 つのセキュリティグループを指定できます。

Tags

List

いいえ

はい

タグです。

最大 20 個のタグを追加できます。

詳細については、「タグのプロパティ」をご参照ください。

MaintainTime

String

いいえ

はい

クラスターのメンテナンスウィンドウです。

フォーマット:HH:mmZ-HH:mmZ。例:16:00Z-17:00Z(これは UTC+08:00 における 00:00~01:00 のメンテナンスウィンドウを示します)。

CreationOption

String

いいえ

いいえ

作成方法です。

有効な値:

デフォルト値:Normal

説明

DBTypeMySQL に設定され、DBVersion8.0 に設定されている場合、このパラメーターを CreateGdnStandby に設定できます。

VSwitchId

String

いいえ

いいえ

vSwitch ID です。

なし

SecurityIPList

String

いいえ

いいえ

PolarDB クラスターの IP アドレスホワイトリストです。

説明

ホワイトリストには複数の IP アドレスを指定できます。複数の IP アドレスはカンマ(,)で区切ります。

CloneDataPoint

String

いいえ

いいえ

データクローンの時点です。

有効な値:

  • LATEST(デフォルト):最新の時点。

    説明

    CreationOption が CloneFromRDS に設定されている場合、このパラメーターは LATEST に設定する必要があります。

  • BackupID:履歴バックアップセットの ID。

  • Timestamp:履歴時点。フォーマット:yyyy-MM-ddTHH:mm:ssZ(UTC)。

説明

CreationOptionCloneFromRDS に設定されている場合、このパラメーターは LATEST に設定する必要があります。

CreationCategory

String

いいえ

いいえ

クラスターのエディションです。

有効な値:

  • Normal:Cluster Edition(デフォルト)

  • Basic:シングルノード

  • ArchiveNormal:高圧縮 X-Engine

  • NormalMultimaster:Multi-master Cluster Edition

  • SENormal:Standard Edition

説明

BasicMySQL 5.65.78.0PostgreSQL 14、および Oracle 構文互換 2.0 でサポートされています。

ArchiveNormal および NormalMultimasterMySQL 8.0 でサポートされています。

SENormalMySQL 5.65.78.0、および PostgreSQL 14 でサポートされています。

BackupRetentionPolicyOnClusterDeletion

String

いいえ

いいえ

クラスター削除時のバックアップ保持ポリシーです。

有効な値:

  • ALL:すべてのバックアップを永続的に保持します。

  • LATEST:最後のバックアップ(削除前の自動バックアップ)を永続的に保持します。

  • NONE(デフォルト):クラスター削除時にバックアップを保持しません。

デフォルトでは、このパラメーターは NONE に設定されており、クラスター削除時にバックアップを保持しないことを意味します。

説明
  • このパラメーターは、DBTypeMySQL に設定されている場合にのみ有効です。

  • このパラメーターは、Serverless クラスターではサポートされていません。

ResourceGroupId

String

いいえ

はい

リソースグループ ID です。

なし

DefaultTimeZone

String

いいえ

いいえ

クラスターのタイムゾーン(UTC)です。

デフォルト値:SYSTEM。デフォルトのタイムゾーンは、リージョンのタイムゾーンと同じです。

有効な値の範囲は -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 または 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

いいえ

いいえ

ストレージクラスです。

Enterprise Edition の有効な値:

  • PSL5

  • PSL4

Standard Edition の有効な値:

  • ESSDPL0

  • ESSDPL1

  • ESSDPL2

  • ESSDPL3

  • ESSDAUTOPL

LooseXEngine

String

いいえ

いいえ

X-Engine ストレージエンジンを有効にします。

有効な値:

  • ON:X-Engine ストレージエンジンを有効にします。

  • OFF:X-Engine ストレージエンジンを無効にします。

説明

このパラメーターは、CreationOptionCreateGdnStandby に設定されておらず、DBTypeMySQL に設定され、DBVersion8.0 に設定されている場合にのみ有効です。X-Engine を有効にしたノードのメモリは、最低でも 16 GB である必要があります。

LoosePolarLogBin

String

いいえ

いいえ

バイナリログを有効にします。

有効な値:

  • ON:バイナリログを有効にします。

  • OFF:バイナリログを無効にします。

説明

このパラメーターは、DBTypeMySQL に設定されている場合にのみ有効です。

StorageSpace

Integer

いいえ

いいえ

サブスクリプション課金のストレージ容量です。

単位:GB。

説明
  • PolarDB for MySQL Standard Edition の場合、有効な値の範囲は 20~32000 です。

  • StorageType が ESSDAUTOPL に設定されている場合、有効な値の範囲は 40~64000 で、最小ステップサイズは 10(例:40、50、60…)です。

ProxyType

String

いいえ

いいえ

データベースプロキシのタイプです。

有効な値:

  • EXCLUSIVE:専用 Enterprise Edition

  • GENERAL:Standard Enterprise Edition

説明

プロキシのタイプは、ノード仕様と一致させる必要があります。

ノード仕様が汎用の場合、ProxyType を Standard Enterprise Edition に設定します。

ノード仕様が専用の場合、ProxyType を Dedicated Enterprise Edition に設定します。

StandbyAZ

String

いいえ

いいえ

ホットスタンバイストレージクラスターのゾーンです。

このパラメーターは、3 ゾーンシナリオにおける Standard Edition クラスターに適用されます。

説明

このパラメーターは、マルチゾーン間の強力な整合性が有効になっている場合にのみ有効です。

LooseXEngineUseMemoryPct

Integer

いいえ

いいえ

X-Engine ストレージエンジンを有効にする割合を設定します。

有効な値:10~90 の整数。

説明

このパラメーターは、LooseXEngineON に設定されている場合にのみ有効です。

StorageUpperBound

Integer

いいえ

いいえ

Standard Edition クラスターの自動ストレージスケーリングの上限です。

単位:GB。

説明

最大値は 32000 です。

StrictConsistency

String

いいえ

いいえ

マルチゾーン間の強力な整合性を有効にするかどうかを指定します。

有効な値:

  • ON:マルチゾーン間の強力な整合性を有効にします。これは、3 ゾーンシナリオにおける Standard Edition クラスターに適用されます。

  • OFF:マルチゾーン間の強力な整合性を無効にします。

StoragePayType

String

いいえ

いいえ

ストレージの課金方法です。

有効な値:

  • Postpaid:容量に基づく従量課金

  • Prepaid:ストレージ容量に基づくサブスクリプション

DBNodeNum

Integer

いいえ

いいえ

Standard Edition および Enterprise Edition クラスターのノード数です。

有効な値:

  • Standard Edition:1~8(1 台の読み書き可能ノードと最大 7 台の読み取り専用ノード)

  • Enterprise Edition:1~16(1 台の読み書き可能ノードと最大 15 台の読み取り専用ノード)

説明
  • Enterprise Edition クラスターのデフォルトノード数は 2、Standard Edition クラスターのデフォルトノード数は 1 です。

  • このパラメーターは、PolarDB for MySQL のみでサポートされます。

  • マルチマスターコンフィグレーションでは、ノード数の変更はサポートされていません。

ProxyClass

String

いいえ

いいえ

Standard Edition クラスターのデータベースプロキシ仕様です。

有効な値:

  • 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:Standard Edition でホットスタンバイクラスターを有効にします。

説明

Standard Edition クラスターのデフォルト値は STANDBY です。

StorageAutoScale

String

いいえ

いいえ

Standard Edition クラスターの自動ストレージスケーリングを有効にするかどうかを指定します。

有効な値:

  • Enable:自動ストレージスケーリングを有効にします。

  • Disable:自動ストレージスケーリングを無効にします。

Architecture

String

いいえ

いいえ

CPU アーキテクチャです。

有効な値:

  • X86

  • ARM

DBMinorVersion

String

いいえ

いいえ

データベースエンジンのマイナーバージョンです。

有効な値:

  • 8.0.2

  • 8.0.1

説明

このパラメーターは、DBTypeMySQL に設定され、DBVersion8.0 に設定されている場合にのみ有効です。

VpcId

String

いいえ

いいえ

VPC ID です。

なし

ParameterGroupId

String

いいえ

いいえ

パラメーターテンプレート ID です。

宛先リージョンにおけるパラメーターテンプレートの一覧および ID を表示するには、DescribeParameterGroups 操作を呼び出します。

RestartMasterNode

Boolean

いいえ

いいえ

プライマリノードを再起動するかどうかを指定します。

有効な値:

  • true:プライマリノードを再起動します。

  • false:プライマリノードを再起動しません。

ColdStorageOption

Map

いいえ

いいえ

コールドデータアーカイブのオプションです。

詳細については、「ColdStorageOption のプロパティ」をご参照ください。

ProvisionedIops

Integer

いいえ

いいえ

ESSD AutoPL ディスクのプロビジョニング IOPS です。

有効な値:0~min{50,000, 1000 × 容量 − ベースラインパフォーマンス}。

ベースラインパフォーマンス = min{1,800 + 50 × 容量, 50,000}。

説明

このパラメーターは、StorageType が ESSDAUTOPL に設定されている場合にのみサポートされます。

タグの構文

"Tags": [
  {
    "Key": String,
    "Value": String
  }
]

タグのプロパティ

プロパティ名

必須

更新が許可されています

説明

制約条件

Key

String

はい

いいえ

タグキーです。

キーは 1~128 文字の長さである必要があります。aliyun または acs: で始めてはならず、http:// または https:// を含めてはいけません。

Value

String

いいえ

いいえ

タグ値です。

値は 0~128 文字の長さである必要があります。aliyun または acs: で始めてはならず、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:Alibaba Cloud Resource Name。

サンプル

シナリオ 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: Existing VPC instance ID
    Label:
      en: VPC ID
      zh-cn: VPC instance ID
  VSwitchZoneId:
    AssociationProperty: ALIYUN::ECS::Instance:ZoneId
    Type: String
    Description:
      zh-cn: vSwitch zone
      en: VSwitch Availability Zone
    Label:
      zh-cn: vSwitch zone
      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: Existing business network vSwitch instance ID
    Label:
      en: VSwitch ID
      zh-cn: vSwitch instance 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": "Existing VPC instance ID"
      },
      "Label": {
        "en": "VPC ID",
        "zh-cn": "VPC instance ID"
      }
    },
    "VSwitchZoneId": {
      "AssociationProperty": "ALIYUN::ECS::Instance:ZoneId",
      "Type": "String",
      "Description": {
        "zh-cn": "vSwitch zone",
        "en": "VSwitch Availability Zone"
      },
      "Label": {
        "zh-cn": "vSwitch zone",
        "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": "Existing business network vSwitch instance ID"
      },
      "Label": {
        "en": "VSwitch ID",
        "zh-cn": "vSwitch instance 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: Native SQL easily realizes multimodal intelligent retrieval.
  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 name
      en: Bucket Name
  ZoneId:
    Type: String
    Label:
      zh-cn: Zone ID
      en: Available Zone ID
    AssociationProperty: ALIYUN::ECS::Instance::ZoneId
  AccountName:
    Type: String
    Label:
      zh-cn: Database username
      en: Account Name
    Description:
      zh-cn: The length should not exceed 16 characters. It begins with a lowercase English letter and can contain lowercase English letters, numbers and underscores (_).
      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: The length should not exceed 16 characters. It begins with a lowercase English letter and can contain lowercase English letters, numbers and underscores (_).
      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: Database access password, length 8-32, must contain three (uppercase letters, lowercase letters, digits, and special characters from !@#$%^&*()_+-=)
    Label:
      en: Account Password
      zh-cn: Database password
    ConstraintDescription:
      en: Length 8-32, must contain three(Capital letters, lowercase letters, numbers, !@#$%^&*()_+-=Special symbol in)
      zh-cn: Length 8-32, must contain three (uppercase letters, lowercase letters, digits, and special characters from !@#$%^&*()_+-=)
    AllowedPattern: '^[0-9A-Za-z_!@#$%^&*()_+\-=\+]+$'
    MinLength: 8
    MaxLength: 32
    NoEcho: true
  DBName:
    Type: String
    Label:
      en: Database Name
      zh-cn: Database name
    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: Composed of lowercase letters, digits, hyphens (-), and underscores (_). It must start with a letter and end with a lowercase letter or digit. Maximum length: 64 characters.
    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: Composed of lowercase letters, digits, hyphens (-), and underscores (_). It must start with a letter and end with a lowercase letter or digit. Maximum length: 64 characters.
    Default: db-test
  PolarDBNodeClass:
    Type: String
    Label:
      en: PolarDB Node Specifications
      zh-cn: Specifications and proxy
    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: OSS bucket name.
    Value:
      Ref: BucketName
  AccountName:
    Description:
      en: PolarDB account name.
      zh-cn: PolarDB database username.
    Value:
      Ref: AccountName
  AccountPassword:
    NoEcho: true
    Description:
      en: PolarDB account password.
      zh-cn: PolarDB database password.
    Value:
      Ref: AccountPassword
  DBName:
    Description:
      en: PolarDB database name.
      zh-cn: PolarDB database name.
    Value:
      Ref: DBName
  ConnectionString:
    Description:
      en: PolarDB database connection string.
      zh-cn: Public endpoint of the PolarDB database.
    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: Basic network configuration
      - Parameters:
          - BucketName
        Label:
          default:
            en: OSS Configuration
            zh-cn: OSS basic configuration
      - Parameters:
          - PolarDBNodeClass
          - DBName
          - AccountName
          - AccountPassword
        Label:
          default:
            en: PolarDB PostgreSQL Configuration
            zh-cn: ApsaraDB PolarDB for PostgreSQL configuration
    TemplateTags:
      - acs:technical-solution:internet-application-development:Native SQL easily realizes multimodal intelligent retrieval-tech_solu_262
    Hidden:
      - CommonName
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "Native SQL easily realizes multimodal intelligent retrieval.",
    "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 name",
        "en": "Bucket Name"
      }
    },
    "ZoneId": {
      "Type": "String",
      "Label": {
        "zh-cn": "Zone ID",
        "en": "Available Zone ID"
      },
      "AssociationProperty": "ALIYUN::ECS::Instance::ZoneId"
    },
    "AccountName": {
      "Type": "String",
      "Label": {
        "zh-cn": "Database username",
        "en": "Account Name"
      },
      "Description": {
        "zh-cn": "The length should not exceed 16 characters. It begins with a lowercase English letter and can contain lowercase English letters, numbers and underscores (_).",
        "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": "The length should not exceed 16 characters. It begins with a lowercase English letter and can contain lowercase English letters, numbers and underscores (_).",
        "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": "Database access password, length 8-32, must contain three (uppercase letters, lowercase letters, digits, and special characters from !@#$%^&*()_+-=)"
      },
      "Label": {
        "en": "Account Password",
        "zh-cn": "Database password"
      },
      "ConstraintDescription": {
        "en": "Length 8-32, must contain three(Capital letters, lowercase letters, numbers, !@#$%^&*()_+-=Special symbol in)",
        "zh-cn": "Length 8-32, must contain three (uppercase letters, lowercase letters, digits, and special characters from !@#$%^&*()_+-=)"
      },
      "AllowedPattern": "^[0-9A-Za-z_!@#$%^&*()_+\\-=\\+]+$",
      "MinLength": 8,
      "MaxLength": 32,
      "NoEcho": true
    },
    "DBName": {
      "Type": "String",
      "Label": {
        "en": "Database Name",
        "zh-cn": "Database name"
      },
      "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": "Composed of lowercase letters, digits, hyphens (-), and underscores (_). It must start with a letter and end with a lowercase letter or digit. Maximum length: 64 characters."
      },
      "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": "Composed of lowercase letters, digits, hyphens (-), and underscores (_). It must start with a letter and end with a lowercase letter or digit. Maximum length: 64 characters."
      },
      "Default": "db-test"
    },
    "PolarDBNodeClass": {
      "Type": "String",
      "Label": {
        "en": "PolarDB Node Specifications",
        "zh-cn": "Specifications and proxy"
      },
      "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": "OSS bucket name."
      },
      "Value": {
        "Ref": "BucketName"
      }
    },
    "AccountName": {
      "Description": {
        "en": "PolarDB account name.",
        "zh-cn": "PolarDB database username."
      },
      "Value": {
        "Ref": "AccountName"
      }
    },
    "AccountPassword": {
      "NoEcho": true,
      "Description": {
        "en": "PolarDB account password.",
        "zh-cn": "PolarDB database password."
      },
      "Value": {
        "Ref": "AccountPassword"
      }
    },
    "DBName": {
      "Description": {
        "en": "PolarDB database name.",
        "zh-cn": "PolarDB database name."
      },
      "Value": {
        "Ref": "DBName"
      }
    },
    "ConnectionString": {
      "Description": {
        "en": "PolarDB database connection string.",
        "zh-cn": "Public endpoint of the PolarDB database."
      },
      "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": "Basic network configuration"
            }
          }
        },
        {
          "Parameters": [
            "BucketName"
          ],
          "Label": {
            "default": {
              "en": "OSS Configuration",
              "zh-cn": "OSS basic configuration"
            }
          }
        },
        {
          "Parameters": [
            "PolarDBNodeClass",
            "DBName",
            "AccountName",
            "AccountPassword"
          ],
          "Label": {
            "default": {
              "en": "PolarDB PostgreSQL Configuration",
              "zh-cn": "ApsaraDB PolarDB for PostgreSQL configuration"
            }
          }
        }
      ],
      "TemplateTags": [
        "acs:technical-solution:internet-application-development:Native SQL easily realizes multimodal intelligent retrieval-tech_solu_262"
      ],
      "Hidden": [
        "CommonName"
      ]
    }
  }
}

その他のサンプルについては、「このリソースを含むパブリックテンプレート」をご参照ください。