ALIYUN::ADB::Account类型用于创建数据库集群账号。

语法

{
  "Type": "ALIYUN::ADB::Account",
  "Properties": {
    "AccountDescription": String,
    "DBClusterId": String,
    "AccountType": String,
    "AccountPassword": String,
    "AccountName": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
AccountDescription String 数据库账号描述。 限制:
  • 不能以http://或者https://开头。
  • 长度不超过256个字符。
DBClusterId String 数据库实例ID。
AccountType String 数据库账号类型。 取值:
  • Normal:普通账号。
  • Super:高权限账号。
AccountPassword String 数据库账号名称的密码。 限制:
  • 密码由大写字母、小写字母、数字以及特殊符号组成。

    特殊符号包含:(!)、(@)、(#)、($)、(%)、(^)、(&)、(*)(())、(_)、(+)、(-)、(=)

  • 密码长度为8~32个字符。
AccountName String 数据库账号名称。

返回值

Fn::GetAtt

  • DBClusterId:数据库集群ID。
  • AccountType:数据库集群账号类型。
  • AccountName:数据库集群账号名称。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "DBClusterId": {
      "Type": "String",
      "Description": "The ID of the cluster."
    },
    "AccountPassword": {
      "Type": "String",
      "Description": "The password of the account.\nThe password must contain uppercase letters, lowercase letters, digits, and special\ncharacters.\nSpecial characters include ! @ # $ % ^ * ()  _ + - and =\nThe password must be 8 to 32 characters in length."
    },
    "AccountName": {
      "Type": "String",
      "Description": "The name of the account."
    }
  },
  "Resources": {
    "Account": {
      "Type": "ALIYUN::ADB::Account",
      "Properties": {
        "DBClusterId": {
          "Ref": "DBClusterId"
        },
        "AccountPassword": {
          "Ref": "AccountPassword"
        },
        "AccountName": {
          "Ref": "AccountName"
        }
      }
    }
  },
  "Outputs": {
    "DBClusterId": {
      "Description": "The ID of the cluster.",
      "Value": {
        "Fn::GetAtt": [
          "Account",
          "DBClusterId"
        ]
      }
    },
    "AccountType": {
      "Description": "The type of the account.",
      "Value": {
        "Fn::GetAtt": [
          "Account",
          "AccountType"
        ]
      }
    },
    "AccountName": {
      "Description": "The name of the account.",
      "Value": {
        "Fn::GetAtt": [
          "Account",
          "AccountName"
        ]
      }
    }
  }
}