ALIYUN::POLARDB::Account類型用於為PolarDB資料庫建立帳號。
文法
{
"Type": "ALIYUN::POLARDB::Account",
"Properties": {
"DBClusterId": String,
"AccountDescription": String,
"AccountName": String,
"AccountPrivilege": String,
"DBName": String,
"AccountType": String,
"PrivForAllDB": String,
"AccountPassword": String
}
}
屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
DBClusterId | String | 是 | 否 | 叢集ID。 | 無 |
AccountDescription | String | 否 | 是 | 帳號描述資訊。 | 長度為2~256個字元。不能以 |
AccountName | String | 是 | 否 | 帳號名。 | 長度不超過16個字元。以小寫英文字母開頭,可包含小寫英文字母、數字和底線(_)。 |
AccountPrivilege | String | 否 | 否 | 帳號許可權。 | 取值:
說明 本參數僅適用於PolarRDB MySQL叢集普通帳號。 |
DBName | String | 否 | 否 | 授權訪問的資料庫名稱。 | 多個資料庫名以英文逗號(,)分隔。 說明 本參數僅適用於PolarDB MySQL叢集普通帳號。 |
PrivForAllDB | String | 否 | 否 | 是否授權當前叢集所有庫及後續新增所有庫的許可權。 | 取值範圍如下:
說明
|
AccountType | String | 否 | 否 | 帳號類型。 | 取值:
|
AccountPassword | String | 是 | 是 | 密碼。 | 長度為8~32個字元。可包含英文字母、數字和以下特殊字元:
|
傳回值
Fn::GetAtt
無
樣本
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
DBClusterId:
Type: String
Description: The ID of the ApsaraDB for POLARDB cluster for which a database account is to be created.
AccountName:
Type: String
Description: The name of the database account to be used.
Default: mytest
AccountPassword:
Type: String
Description: |-
The password of the database account. The password must comply with the following rules:
- It must consist of uppercase letters, lowercase letters, digits, and special characters.
- Special characters include exclamation points (!), number signs (#), dollar signs ($), percent signs (%), carets (^), ampersands (&), asterisks (*), parentheses (()), underscores (_), plus signs (+), hyphens (-), and equal signs (=).
- It must be 8 to 32 characters in length.
MinLength: 8
MaxLength: 32
Resources:
Account:
Type: ALIYUN::POLARDB::Account
Properties:
DBClusterId:
Ref: DBClusterId
AccountName:
Ref: AccountName
AccountPrivilege: ReadOnly
AccountPassword:
Ref: AccountPassword
AccountType: Normal
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"DBClusterId": {
"Type": "String",
"Description": "The ID of the ApsaraDB for POLARDB cluster for which a database account is to be created."
},
"AccountName": {
"Type": "String",
"Description": "The name of the database account to be used.",
"Default": "mytest"
},
"AccountPassword": {
"Type": "String",
"Description": "The password of the database account. The password must comply with the following rules:\n- It must consist of uppercase letters, lowercase letters, digits, and special characters.\n- Special characters include exclamation points (!), number signs (#), dollar signs ($), percent signs (%), carets (^), ampersands (&), asterisks (*), parentheses (()), underscores (_), plus signs (+), hyphens (-), and equal signs (=).\n- It must be 8 to 32 characters in length.",
"MinLength": 8,
"MaxLength": 32
}
},
"Resources": {
"Account": {
"Type": "ALIYUN::POLARDB::Account",
"Properties": {
"DBClusterId": {
"Ref": "DBClusterId"
},
"AccountName": {
"Ref": "AccountName"
},
"AccountPrivilege": "ReadOnly",
"AccountPassword": {
"Ref": "AccountPassword"
},
"AccountType": "Normal"
}
}
}
}