All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::RDS::Accounts

最終更新日:Dec 06, 2024

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

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

DBInstanceId

String

Yes

Yes

The instance ID.

Note

Instances that run SQL Server 2017 EE or PostgreSQL are not supported.

AccountName

String

No

Yes

The name of the database account.

None.

RefreshOptions

String

No

Yes

The refresh policy for data source resources when the stack is updated.

Valid values:

  • Never (default): does not refresh data source resources when the stack is updated.

  • Always: refreshes data source resources when the stack is updated.

Return values (Fn::GetAtt)

  • AccountNames: the names of the database accounts.

  • Accounts: details of the database accounts.

Property

Type

Description

Constraint

AccountNames

List

The names of the database accounts.

None.

Accounts

List

Details of the database accounts.

None.

AccountStatus

String

The status 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

{
  "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"
        ]
      }
    }
  }
}
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