ALIYUN::ClickHouse::EnterpriseDBClusterAccount

更新时间:
复制为 MD 格式

ALIYUN::ClickHouse::EnterpriseDBClusterAccount类型用于为云数据库ClickHouse企业版集群创建数据库账号。

语法

{
  "Type": "ALIYUN::ClickHouse::EnterpriseDBClusterAccount",
  "Properties": {
    "Account": String,
    "AccountType": String,
    "DBInstanceId": String,
    "Password": String,
    "Description": String,
    "DmlAuthSetting": Map
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Account

String

数据库账号的名称。

AccountType

String

数据库账号的类型。

取值范围:

  • NormalAccount:普通账号。

  • SuperAccount:高权限账号。

DBInstanceId

String

集群ID。

Password

String

数据库账号密码。

需满足以下规则。- 由大写字母、小写字母、数字和特殊字符中的至少三种组成。- Oh-! @#$%^& *()_+-= 为特殊字符。- 长度为8~32个字符。

Description

String

账号的描述。

DmlAuthSetting

Map

权限信息。

DmlAuthSetting语法

"DmlAuthSetting": {
  "DdlAuthority": Boolean,
  "DmlAuthority": Integer,
  "AllowDictionaries": List,
  "AllowDatabases": List
}

DmlAuthSetting属性

属性名称

类型

必须

允许更新

描述

约束

DdlAuthority

Boolean

是否授予数据库账号DDL权限。

取值说明:

  • true:允许DDL。

  • false:禁用DDL。

DmlAuthority

Integer

是否授予数据库账号

DML权限。取值如下:

  • 0:允许读取、写入和更改设置的查询。

  • 1:仅允许读取数据的查询。

  • 2:允许读取数据和更改设置的查询。

AllowDatabases

List

需要授权的数据库列表。

AllowDictionaries

List

需要授权的字典列表。

返回值

Fn::GetAtt

  • Account:数据库账号的名称。

  • Description:账号的描述。

  • AccountType:数据库账号的类型。

  • DmlAuthSetting:权限信息。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Account:
    Type: String
    Description:
      en: The name of the database account.
      zh: 数据库账号的名称。
    Required: true
  DBInstanceId:
    Type: String
    Description:
      en: The cluster ID.
      zh: 集群ID。
    Required: true
  AccountType:
    Type: String
    Description:
      en: |-
        The type of the database account. Valid values:
        - **NormalAccount**: Normal account number.
        - **SuperAccount**: The privileged account.
      zh: |-
        数据库账号的类型。取值范围:
        - **NormalAccount**:普通账号。
        - **SuperAccount**:高权限账号。
    AllowedValues:
      - NormalAccount
      - SuperAccount
    Required: true
  Password:
    Type: String
    Description:
      en: |-
        Database account password. Set the following rules.
        - Consists of at least three of uppercase letters, lowercase letters, numbers, and special characters.
        - Oh-! @#$%^& *()_+-= is a special character.
        - Length is 8~32 characters.
      zh: |-
        数据库账号密码。需满足以下规则。
        - 由大写字母、小写字母、数字和特殊字符中的至少三种组成。
        - Oh-! @#$%^& *()_+-= 为特殊字符。
        - 长度为8~32个字符。
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::ClickHouse::EnterpriseDBClusterAccount
    Properties:
      Account:
        Ref: Account
      DBInstanceId:
        Ref: DBInstanceId
      AccountType:
        Ref: AccountType
      Password:
        Ref: Password
Outputs:
  Account:
    Description:
      en: The name of the database account.
      zh: 数据库账号的名称。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Account
  Description:
    Description:
      en: The description of the account.
      zh: 账号的描述。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Description
  AccountType:
    Description:
      en: The type of the database account.
      zh: 数据库账号的类型。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - AccountType
  DmlAuthSetting:
    Description:
      en: The information about permissions.
      zh: 权限信息。
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - DmlAuthSetting
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Account": {
      "Type": "String",
      "Description": {
        "en": "The name of the database account.",
        "zh": "数据库账号的名称。"
      },
      "Required": true
    },
    "DBInstanceId": {
      "Type": "String",
      "Description": {
        "en": "The cluster ID.",
        "zh": "集群ID。"
      },
      "Required": true
    },
    "AccountType": {
      "Type": "String",
      "Description": {
        "en": "The type of the database account. Valid values:\n- **NormalAccount**: Normal account number.\n- **SuperAccount**: The privileged account.",
        "zh": "数据库账号的类型。取值范围:\n- **NormalAccount**:普通账号。\n- **SuperAccount**:高权限账号。"
      },
      "AllowedValues": [
        "NormalAccount",
        "SuperAccount"
      ],
      "Required": true
    },
    "Password": {
      "Type": "String",
      "Description": {
        "en": "Database account password. Set the following rules.\n- Consists of at least three of uppercase letters, lowercase letters, numbers, and special characters.\n- Oh-! @#$%^& *()_+-= is a special character.\n- Length is 8~32 characters.",
        "zh": "数据库账号密码。需满足以下规则。\n- 由大写字母、小写字母、数字和特殊字符中的至少三种组成。\n- Oh-! @#$%^& *()_+-= 为特殊字符。\n- 长度为8~32个字符。"
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::ClickHouse::EnterpriseDBClusterAccount",
      "Properties": {
        "Account": {
          "Ref": "Account"
        },
        "DBInstanceId": {
          "Ref": "DBInstanceId"
        },
        "AccountType": {
          "Ref": "AccountType"
        },
        "Password": {
          "Ref": "Password"
        }
      }
    }
  },
  "Outputs": {
    "Account": {
      "Description": {
        "en": "The name of the database account.",
        "zh": "数据库账号的名称。"
      },
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Account"
        ]
      }
    },
    "Description": {
      "Description": {
        "en": "The description of the account.",
        "zh": "账号的描述。"
      },
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Description"
        ]
      }
    },
    "AccountType": {
      "Description": {
        "en": "The type of the database account.",
        "zh": "数据库账号的类型。"
      },
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "AccountType"
        ]
      }
    },
    "DmlAuthSetting": {
      "Description": {
        "en": "The information about permissions.",
        "zh": "权限信息。"
      },
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "DmlAuthSetting"
        ]
      }
    }
  }
}