ALIYUN::POLARDB::Database is used to create a database in a PolarDB cluster.
Syntax
{
"Type": "ALIYUN::POLARDB::Database",
"Properties": {
"CharacterSetName": String,
"DBClusterId": String,
"DBName": String,
"AccountPrivilege": String,
"AccountName": String,
"Collate": String,
"Ctype": String,
"DBDescription": String
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
CharacterSetName | String | Yes | No | The character set. | For more information, see Character set tables. |
DBClusterId | String | Yes | No | The ID of the cluster. | None. |
DBName | String | Yes | No | The name of the database. | The name must meet the following requirements:
|
AccountPrivilege | String | No | No | The permissions of the account. | Valid values:
If you leave this property empty, the default value ReadWrite is used. Note
|
AccountName | String | No | No | The name of the account that is granted permissions to access the database. | Note
|
Collate | String | No | No | A language environment setting. | This property is used to specify the collation of the databases that are created. Note
|
Ctype | String | No | No | A language environment setting. | This property is used to specify the character type of the database. Note
|
DBDescription | String | No | Yes | The description of the database. | The description must meet the following requirements:
Note This property is required for PolarDB for Oracle and PolarDB for PostgreSQL clusters. This property is optional for PolarDB for MySQL clusters. |
Return values
Fn::GetAtt
None.
Examples
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
CharacterSetName:
AssociationPropertyMetadata:
AutoChangeType: false
Type: String
Description:
en: The character set of the database. For more information, see Character sets.
AllowedValues:
- utf8
- geostd8
- gbk
- greek
- utf8mb4
- hebrew
- latin1
- hp8
- euckr
- keybcs2
- armscii8
- koi8r
- ascii
- koi8u
- big5
- latin2
- binary
- latin5
- cp1250
- latin7
- cp1251
- macce
- cp1256
- macroman
- cp1257
- sjis
- cp850
- swe7
- cp852
- tis620
- cp866
- ucs2
- cp932
- ujis
- dec8
- utf16
- eucjpms
- utf16le
- gb2312
Required: true
DBClusterId:
AssociationProperty: ALIYUN::POLARDB::DBCluster::DBClusterId
Type: String
Description:
en: The ID of the ApsaraDB for POLARDB cluster for which a database is to be created.
Required: true
DBName:
Type: String
Description:
en: |-
The name of the database to be created. The name must comply with the following rules:
It must start with a lowercase letter and consist of lowercase letters, digits, hyphens
(-), and underscores (_).
It must end with a letter or a digit. It can be up to 64 characters in length.
AllowedPattern: ^[a-z0-9][-_a-z0-9]{0,63}(?<![-_]$)$
Required: true
Resources:
Database:
Type: ALIYUN::POLARDB::Database
Properties:
CharacterSetName:
Ref: CharacterSetName
DBClusterId:
Ref: DBClusterId
DBName:
Ref: DBName
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"CharacterSetName": {
"AssociationPropertyMetadata": {
"AutoChangeType": false
},
"Type": "String",
"Description": {
"en": "The character set of the database. For more information, see Character sets."
},
"AllowedValues": [
"utf8",
"geostd8",
"gbk",
"greek",
"utf8mb4",
"hebrew",
"latin1",
"hp8",
"euckr",
"keybcs2",
"armscii8",
"koi8r",
"ascii",
"koi8u",
"big5",
"latin2",
"binary",
"latin5",
"cp1250",
"latin7",
"cp1251",
"macce",
"cp1256",
"macroman",
"cp1257",
"sjis",
"cp850",
"swe7",
"cp852",
"tis620",
"cp866",
"ucs2",
"cp932",
"ujis",
"dec8",
"utf16",
"eucjpms",
"utf16le",
"gb2312"
],
"Required": true
},
"DBClusterId": {
"AssociationProperty": "ALIYUN::POLARDB::DBCluster::DBClusterId",
"Type": "String",
"Description": {
"en": "The ID of the ApsaraDB for POLARDB cluster for which a database is to be created."
},
"Required": true
},
"DBName": {
"Type": "String",
"Description": {
"en": "The name of the database to be created. The name must comply with the following rules:\nIt must start with a lowercase letter and consist of lowercase letters, digits, hyphens\n(-), and underscores (_).\nIt must end with a letter or a digit. It can be up to 64 characters in length."
},
"AllowedPattern": "^[a-z0-9][-_a-z0-9]{0,63}(?<![-_]$)$",
"Required": true
},
},
"Resources": {
"Database": {
"Type": "ALIYUN::POLARDB::Database",
"Properties": {
"CharacterSetName": {
"Ref": "CharacterSetName"
},
"DBClusterId": {
"Ref": "DBClusterId"
},
"DBName": {
"Ref": "DBName"
}
}
}
}
}