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 | 是 | 是 | 账户权限。 | 取值: 
 | 
返回值
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": {
  }
}该文章对您有帮助吗?