ALIYUN::DRDS::Account

ALIYUN::DRDS::Account类型用于创建实例级账号。

语法

{
  "Type": "ALIYUN::DRDS::Account",
  "Properties": {
    "DbPrivileges": List,
    "DrdsAccountName": String,
    "InstanceId": String,
    "Password": String,
    "Description": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

DbPrivileges

List

数据库权限信息。

更多信息,请参见DbPrivileges属性

DrdsAccountName

String

账号名称。

InstanceId

String

实例ID。

Password

String

账号密码。

Description

String

账号描述。

DbPrivileges语法

"DbPrivileges": [
  {
    "DbName": String,
    "Privilege": String
  }
]

DbPrivileges属性

属性名称

类型

必须

允许更新

描述

约束

DbName

String

数据库名称。

Privilege

String

账户权限。

取值:

  • R:读取权限。

  • W:写入权限。

  • DDL:执行DDL(数据定义语言)操作的权限。

  • DML:执行DML(数据操作语言)操作的权限。

返回值

Fn::GetAtt

  • DbPrivileges:数据库权限信息。

  • Description:账号描述。

  • DrdsAccountName:账号名称。

  • Host:数据库的访问地址。

  • AccountType:账号类型。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  DbPrivileges:
    AssociationPropertyMetadata:
      Parameters:
        DbName:
          Type: String
          Description:
            en: The name of the database.
          Required: true
        Privilege:
          Type: String
          Description:
            en: |-
              Account permissions.
              - **R**: read permission.
              - **W**: write permission.
              - **DDL**: the permission to perform DDL operations.
              - **DML**: the permission to perform DML operations.
          AllowedValues:
            - R
            - W
            - DDL
            - DML
          Required: true
    AssociationProperty: List[Parameters]
    Type: Json
    Description:
      en: Database permission information.
    Required: true
    MinLength: 1
    MaxLength: 1000
  DrdsAccountName:
    Type: String
    Description:
      en: The name of the account.
    Required: true
  InstanceId:
    Type: String
    Description:
      en: The ID of the instance.
    Required: true
  Password:
    Type: String
    Description:
      en: The password of the account.
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::DRDS::Account
    Properties:
      DbPrivileges:
        Ref: DbPrivileges
      DrdsAccountName:
        Ref: DrdsAccountName
      InstanceId:
        Ref: InstanceId
      Password:
        Ref: Password
Outputs: {}
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "DbPrivileges": {
      "AssociationPropertyMetadata": {
        "Parameters": {
          "DbName": {
            "Type": "String",
            "Description": {
              "en": "The name of the database."
            },
            "Required": true
          },
          "Privilege": {
            "Type": "String",
            "Description": {
              "en": "Account permissions.\n- **R**: read permission.\n- **W**: write permission.\n- **DDL**: the permission to perform DDL operations.\n- **DML**: the permission to perform DML operations."
            },
            "AllowedValues": [
              "R",
              "W",
              "DDL",
              "DML"
            ],
            "Required": true
          }
        }
      },
      "AssociationProperty": "List[Parameters]",
      "Type": "Json",
      "Description": {
        "en": "Database permission information."
      },
      "Required": true,
      "MinLength": 1,
      "MaxLength": 1000
    },
    "DrdsAccountName": {
      "Type": "String",
      "Description": {
        "en": "The name of the account."
      },
      "Required": true
    },
    "InstanceId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the instance."
      },
      "Required": true
    },
    "Password": {
      "Type": "String",
      "Description": {
        "en": "The password of the account."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::DRDS::Account",
      "Properties": {
        "DbPrivileges": {
          "Ref": "DbPrivileges"
        },
        "DrdsAccountName": {
          "Ref": "DrdsAccountName"
        },
        "InstanceId": {
          "Ref": "InstanceId"
        },
        "Password": {
          "Ref": "Password"
        }
      }
    }
  },
  "Outputs": {
  }
}