All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::POLARDB::AccountPrivilege

Last Updated:Jun 17, 2026

Memberikan izin kepada akun standar untuk mengakses satu atau beberapa database dalam kluster PolarDB.

Syntax

{
  "Type": "ALIYUN::POLARDB::AccountPrivilege",
  "Properties": {
    "DBClusterId": String,
    "AccountPrivilege": String,
    "DBName": String,
    "AccountName": String
  }
}

Properties

Property Type Required Update allowed Description Constraints
DBClusterId String Yes No ID kluster PolarDB. None.
AccountPrivilege String Yes No Hak istimewa akun pada database. Nilai yang valid: `ReadWrite`, `ReadOnly`, `DMLOnly`, dan `DDLOnly`. Jumlah hak istimewa harus sesuai dengan jumlah nama database yang ditentukan untuk `DBName`, dan hak istimewa tersebut harus berurutan sesuai dengan nama database.
DBName String Yes No Nama database tempat memberikan izin. Anda dapat menentukan satu atau beberapa database. Pisahkan beberapa nama database dengan koma (,).
AccountName String Yes No Nama akun. None.

Return value

Fn::GetAtt

None.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "AccountPrivilege": {
      "Type": "ALIYUN::POLARDB::AccountPrivilege",
      "Properties": {
        "DBClusterId": {
          "Ref": "DBClusterId"
        },
        "AccountPrivilege": {
          "Ref": "AccountPrivilege"
        },
        "DBName": {
          "Ref": "DBName"
        },
        "AccountName": {
          "Ref": "AccountName"
        }
      }
    }
  },
  "Parameters": {
    "DBClusterId": {
      "Type": "String",
      "Description": "The ID of the PolarDB cluster."
    },
    "AccountPrivilege": {
      "MinLength": 1,
      "Type": "String",
      "Description": "The permissions of the account on the database. Valid values are ReadWrite, ReadOnly, DMLOnly, and DDLOnly. The number of permissions must be the same as the number of database names specified for DBName, and the permissions must correspond to the database names in sequence. Separate multiple permissions with a comma (,)."
    },
    "DBName": {
      "MinLength": 1,
      "Type": "String",
      "Description": "The name of the database. To grant permissions on multiple databases, separate the database names with a comma (,)."
    },
    "AccountName": {
      "MinLength": 1,
      "Type": "String",
      "Description": "The name of the account.",
      "MaxLength": 16
    }
  }
}

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  AccountPrivilege:
    Type: ALIYUN::POLARDB::AccountPrivilege
    Properties:
      DBClusterId:
        Ref: DBClusterId
      AccountPrivilege:
        Ref: AccountPrivilege
      DBName:
        Ref: DBName
      AccountName:
        Ref: AccountName
Parameters:
  DBClusterId:
    Type: String
    Description: The ID of the PolarDB cluster.
  AccountPrivilege:
    MinLength: 1
    Type: String
    Description: The permissions of the account on the database. Valid values are ReadWrite,
      ReadOnly, DMLOnly, and DDLOnly. The number of permissions must be the same
      as the number of database names specified for DBName, and the permissions must
      correspond to the database names in sequence. Separate multiple permissions
      with a comma (,).
  DBName:
    MinLength: 1
    Type: String
    Description: The name of the database. To grant permissions on multiple databases,
      separate the database names with a comma (,).
  AccountName:
    MinLength: 1
    Type: String
    Description: The name of the account.
    MaxLength: 16