The ALIYUN::POLARDB::DBCluster resource type creates a PolarDB cluster.
Syntax
{
"Type": "ALIYUN::POLARDB::DBCluster",
"Properties": {
"VpcId": String,
"DBClusterDescription": String,
"DBType": String,
"ClusterNetworkType": String,
"RenewalStatus": String,
"AutoRenewPeriod": Integer,
"Period": Integer,
"ZoneId": String,
"SecurityGroupIds": List,
"Tags": List,
"SourceResourceId": String,
"MaintainTime": String,
"DBVersion": String,
"CreationOption": String,
"DBNodeClass": String,
"VSwitchId": String,
"SecurityIPList": String,
"CloneDataPoint": String,
"PayType": String,
"CreationCategory": String,
"BackupRetentionPolicyOnClusterDeletion": String,
"ResourceGroupId": String,
"DefaultTimeZone": String,
"GDNId": String,
"LowerCaseTableNames": Integer,
"DBClusterParameters": Map,
"TDEStatus": Boolean,
"PeriodUnit": String,
"ScaleRoNumMin": Integer,
"ScaleMax": Integer,
"AllowShutDown": Boolean,
"ServerlessType": String,
"ScaleRoNumMax": Integer,
"ScaleMin": Integer,
"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
}
}Properties
Property Name | Type | Required | Update allowed | Description | Constraints |
DBType | String | Yes | No | The database engine type. | Valid values:
|
DBNodeClass | String | Yes | No | The node specifications. | For more information about node specifications, see the following topics:
Note To create a Serverless cluster in PolarDB for MySQL Cluster Edition, set this parameter to polar.mysql.sl.small. To create a Serverless cluster in PolarDB for MySQL Standard Edition, set this parameter to polar.mysql.sl.small.c. To create a Serverless cluster in PolarDB for PostgreSQL (Compatible with Oracle) or PolarDB for PostgreSQL, set this parameter to polar.pg.sl.small.c. |
DBVersion | String | Yes | No | The database version. | Valid values:
|
PayType | String | Yes | Yes | The billing method. | Valid values:
|
AutoRenewPeriod | Integer | No | Yes | The auto-renewal period for the instance. | Valid values:
Unit: months. |
DBClusterDescription | String | No | Yes | The cluster description. | The description must be 2 to 256 characters in length. It must start with a letter or a Chinese character and cannot start with |
ClusterNetworkType | String | No | No | The network type of the cluster. | Only VPC is supported. Valid value: VPC. |
RenewalStatus | String | No | Yes | The auto-renewal status. | Valid values:
|
Period | Integer | No | Yes | The subscription duration. This parameter takes effect only when PayType is set to Prepaid. | Valid values:
Unit: months. |
ZoneId | String | No | No | The zone ID. | You can call the DescribeRegions operation to query available zones. |
SourceResourceId | String | No | No | The ID of the source RDS instance or source PolarDB cluster. | The ID of the source RDS instance or source PolarDB cluster. This parameter is required only when CreationOption is set to MigrationFromRDS, CloneFromRDS, CloneFromPolarDB, or RecoverFromRecyclebin.
|
SecurityGroupIds | List | No | Yes | The list of security group IDs. | You can specify up to three security groups. |
Tags | List | No | Yes | The tags. | You can add up to 20 tags. For more information, see Tags properties. |
MaintainTime | String | No | Yes | The maintenance window of the cluster. | Format: HH:mmZ-HH:mmZ. Example: 16:00Z-17:00Z, which indicates the maintenance window from 00:00 to 01:00 (UTC+8). |
CreationOption | String | No | No | The creation method. | Valid values:
Default value: Normal. Note If DBType is set to MySQL and DBVersion is set to 8.0, you can set this parameter to CreateGdnStandby. |
VSwitchId | String | No | No | The vSwitch ID. | None |
SecurityIPList | String | No | No | The IP address whitelist of the PolarDB cluster. | Note You can specify multiple IP addresses in the whitelist. Separate multiple IP addresses with commas (,). |
CloneDataPoint | String | No | No | The point in time for cloning data. | Valid values:
Note If CreationOption is set to CloneFromRDS, this parameter must be set to LATEST. |
CreationCategory | String | No | No | The cluster edition. | Valid values:
Note Basic is supported for MySQL 5.6, 5.7, 8.0, PostgreSQL 14, and Oracle syntax-compatible 2.0. ArchiveNormal and NormalMultimaster are supported for MySQL 8.0. SENormal is supported for MySQL 5.6, 5.7, 8.0, and PostgreSQL 14. |
BackupRetentionPolicyOnClusterDeletion | String | No | No | The backup retention policy when the cluster is deleted. | Valid values:
By default, this parameter is set to NONE, which means that no backups are retained when the cluster is deleted. Note
|
ResourceGroupId | String | No | Yes | The resource group ID. | None |
DefaultTimeZone | String | No | No | The cluster time zone (UTC). | Default value: SYSTEM. The default time zone is the same as the region time zone. Valid values range from -12:00 to +13:00, such as 00:00. Note This parameter takes effect only when DBType is set to MySQL. |
GDNId | String | No | No | The Global Database Network ID. | This parameter is required when CreationOption is set to CreateGdnStandby. |
LowerCaseTableNames | Integer | No | No | Specifies whether table names are case-sensitive. | Valid values:
Note This parameter takes effect only when DBType is set to MySQL. |
DBClusterParameters | Map | No | Yes | The parameters of the PolarDB cluster. | For more information, see DBClusterParameters properties. |
DeletionProtection | Boolean | No | Yes | Specifies whether deletion protection is enabled. | Valid values:
|
TDEStatus | Boolean | No | Yes | Specifies whether transparent data encryption (TDE) is enabled. | Valid values:
Note This parameter takes effect only when DBType is set to PostgreSQL or Oracle. |
PeriodUnit | String | No | Yes | The time unit. | Valid values:
|
ScaleRoNumMin | Integer | No | No | The minimum number of read-only nodes for scale-out and scale-in. | Valid values: 0 to 15. Note This parameter is supported only for Serverless clusters. |
ScaleMax | Integer | No | No | The maximum capacity for scale-out and scale-in of a single node. | Valid values: 1 PCU to 32 PCU. Note This parameter is supported only for Serverless clusters. |
AllowShutDown | Boolean | No | No | Specifies whether No-activity Suspension is enabled. | Valid values:
Note This parameter is supported only for Serverless clusters. |
ServerlessType | String | No | No | The Serverless service type. | Valid value: AgileServerless. Note This parameter is supported only for Serverless clusters. |
ScaleRoNumMax | Integer | No | No | The maximum number of read-only nodes for scale-out and scale-in. | Valid values: 0 to 15. Note This parameter is supported only for Serverless clusters. |
ScaleMin | Integer | No | No | The minimum capacity for scale-out and scale-in of a single node. | Valid values: 1 PCU to 31 PCU. Note This parameter is supported only for Serverless clusters. |
SSLEnabled | String | No | Yes | Modify the SSL status. | Valid values:
|
StorageType | String | No | No | The storage class. | Valid values for Enterprise Edition:
Valid values for Standard Edition:
|
LooseXEngine | String | No | No | Enable the X-Engine storage engine. | Valid values:
Note This parameter takes effect only when CreationOption is not set to CreateGdnStandby, DBType is set to MySQL, and DBVersion is set to 8.0. The memory of nodes with X-Engine enabled must be at least 16 GB. |
LoosePolarLogBin | String | No | No | Enable binary logging. | Valid values:
Note This parameter takes effect only when DBType is set to MySQL. |
StorageSpace | Integer | No | No | The storage space for subscription billing. | Unit: GB. Note
|
ProxyType | String | No | No | The database proxy type. | Valid values:
Note The proxy type must match the node specifications: If the node specifications are general-purpose, set ProxyType to Standard Enterprise Edition. If the node specifications are dedicated, set ProxyType to Dedicated Enterprise Edition. |
StandbyAZ | String | No | No | The zone of the hot standby storage cluster. | This parameter applies to Standard Edition clusters in a three-zone scenario. Note This parameter takes effect only when strong consistency across multiple zones is enabled. |
LooseXEngineUseMemoryPct | Integer | No | No | Set the percentage at which to enable the X-Engine storage engine. | Valid values: integers from 10 to 90. Note This parameter takes effect only when LooseXEngine is set to ON. |
StorageUpperBound | Integer | No | No | The upper limit for automatic storage scaling of Standard Edition clusters. | Unit: GB. Note The maximum value is 32000. |
StrictConsistency | String | No | No | Specifies whether strong consistency across multiple zones is enabled. | Valid values:
|
StoragePayType | String | No | No | The storage billing method. | Valid values:
|
DBNodeNum | Integer | No | No | The number of nodes for Standard Edition and Enterprise Edition clusters. | Valid values:
Note
|
ProxyClass | String | No | No | The database proxy specifications for Standard Edition clusters. | Valid values:
|
HotStandbyCluster | String | No | No | Specifies whether the hot standby cluster is enabled. | Valid values:
Note The default value for Standard Edition clusters is STANDBY. |
StorageAutoScale | String | No | No | Specifies whether automatic storage scaling is enabled for Standard Edition clusters. | Valid values:
|
Architecture | String | No | No | The CPU architecture. | Valid values:
|
DBMinorVersion | String | No | No | The minor version of the database engine. | Valid values:
Note This parameter takes effect only when DBType is set to MySQL and DBVersion is set to 8.0. |
VpcId | String | No | No | The VPC ID. | None |
ParameterGroupId | String | No | No | The parameter template ID. | You can call the DescribeParameterGroups operation to view the parameter template list and IDs in the destination region. |
RestartMasterNode | Boolean | No | No | Specifies whether to restart the primary node. | Valid values:
|
ColdStorageOption | Map | No | No | The cold data archiving options. | For more information, see ColdStorageOption properties. |
ProvisionedIops | Integer | No | No | The provisioned IOPS for ESSD AutoPL disks. | Valid values: 0 to min{50,000, 1000 × capacity − baseline performance}. Baseline performance = min{1,800 + 50 × capacity, 50,000}. Note This parameter is supported only when StorageType is set to ESSDAUTOPL. |
Tags syntax
"Tags": [
{
"Key": String,
"Value": String
}
] Tags properties
Property name | Type | Required | Update allowed | Description | Constraints |
Key | String | Yes | No | The tag key. | The key must be 1 to 128 characters in length. It cannot start with |
Value | String | No | No | The tag value. | The value must be 0 to 128 characters in length. It cannot start with |
DBClusterParameters syntax
"DBClusterParameters": {
"Parameters": String,
"EffectiveTime": String
}DBClusterParameters properties
Property Name | Type | Required | Update allowed | Description | Constraints |
Parameters | String | No | Yes | A JSON string of parameters and their values. | All parameter values are strings. |
EffectiveTime | String | No | Yes | The effective time of the parameters. | Valid values:
|
ColdStorageOption syntax
"ColdStorageOption": {
"Description": String,
"Enable": Boolean
}ColdStorageOption properties
Property Name | Type | Required | Update allowed | Description | Constraints |
Description | String | No | No | The description. | If a description is specified, cold data archiving is enabled. The description can be up to 256 characters in length. |
Enable | Boolean | No | No | Enable cold data archiving. | Valid values:
|
Return values
Fn::GetAtt
DBClusterId: The cluster ID.
OrderId: The order ID.
DBNodeIds: The cluster node IDs.
PrimaryEndpointId: The primary endpoint ID.
CustomEndpointIds: The custom cluster endpoint IDs.
CustomConnectionStrings: The custom connection strings.
PrimaryConnectionString: The primary connection string.
ClusterConnectionString: The cluster connection string.
ClusterEndpointId: The cluster endpoint ID.
PrimaryEndpointIds: The list of primary endpoint IDs.
PrimaryConnectionStrings: The list of primary endpoint connection strings.
ColdStorageInstanceId: The cold database instance ID.
DBClusterDescription: The cluster description.
Arn: The Alibaba Cloud Resource Name.
Examples
Scenario 1: Create a PolarDB cluster of the MySQL type.
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"
]
}
}
}
}Scenario 2: Create a PolarDB cluster of the PostgreSQL type.
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"
}
}
}
}Scenario 3: Use native SQL to implement multimodal intelligent retrieval.
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"
]
}
}
}For more examples, see Public templates that contain this resource.