DATASOURCE::RDS::Accounts is used to query the database accounts of an ApsaraDB RDS instance.

Syntax

{
  "Type": "DATASOURCE::RDS::Accounts",
  "Properties": {
    "DBInstanceId": String,
    "AccountName": String
  }
}

Properties

Property Type Required Editable Description Constraint
DBInstanceId String Yes Yes The ID of the instance.
Note Instances that run SQL Server 2017 EE or PostgreSQL are not supported.
AccountName String No Yes The name of the database account. None

Response parameters (Fn::GetAtt)

  • AccountNames: the names of the database accounts.
  • Accounts: details of the database accounts.
Parameter Type Description Constraint
AccountNames List The names of the database accounts. None.
Accounts List Details of the database accounts. None.
AccountStatus String The state of the database account. Valid values:
  • Unavailable
  • Available
AccountDescription String The description of the database account. None.
DBInstanceId String The ID of the instance to which the database account belongs. None.
PrivExceeded String Indicates whether the number of databases that are managed by the database account exceeds the upper limit. Valid values:
  • 1: The number of databases that are managed by the database account exceeds the upper limit.
  • 0: The number of databases that are managed by the database account does not exceed the upper limit.
AccountType String The type of the database account. Valid values:
  • Normal: standard account
  • Super: privileged account
  • Sysadmin: superuser account that has the system administrator permissions
AccountName String The name of the database account. None.
DatabasePrivileges Map Details of the database permissions that are granted to the database account. Example:
{
          "AccountPrivilege" : "ReadWrite",
          "AccountPrivilegeDetail" : "SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,REFERENCES,INDEX,ALTER,CREATE TEMPORARY TABLES,LOCK TABLES,CREATE VIEW,SHOW VIEW,CREATE ROUTINE,ALTER ROUTINE,EXECUTE,EVENT,TRIGGER",
          "DBName" : "testdb"
        }

Examples

  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "DBInstanceId": {
          "Type": "String",
          "Description": "The ID of the RDS instance."
        }
      },
      "Resources": {
        "ExtensionDataSource": {
          "Type": "DATASOURCE::RDS::Accounts",
          "Properties": {
            "DBInstanceId": {
              "Ref": "DBInstanceId"
            }
          }
        }
      },
      "Outputs": {
        "AccountNames": {
          "Description": "The list of The RDS account names.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "AccountNames"
            ]
          }
        },
        "Accounts": {
          "Description": "The list of The RDS accounts.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "Accounts"
            ]
          }
        }
      }
    }
  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      DBInstanceId:
        Type: String
        Description: The ID of the RDS instance.
    Resources:
      ExtensionDataSource:
        Type: DATASOURCE::RDS::Accounts
        Properties:
          DBInstanceId:
            Ref: DBInstanceId
    Outputs:
      AccountNames:
        Description: The list of The RDS account names.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - AccountNames
      Accounts:
        Description: The list of The RDS accounts.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - Accounts