All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::PolarDBX::Accounts

Last Updated:Apr 23, 2025

DATASOURCE::PolarDBX::Accounts is used to query PolarDB for Xscale (PolarDB-X) accounts.

Syntax

{
  "Type": "DATASOURCE::PolarDBX::Accounts",
  "Properties": {
    "DBInstanceId": String,
    "AccountType": Integer,
    "PolarDBXAccountName": String,
    "RefreshOptions": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

DBInstanceId

String

Yes

Yes

The ID of the PolarDB-X instance.

None.

AccountType

Integer

No

Yes

The type of the account.

Valid values:

  • 0: standard account.

  • 1: privileged account.

PolarDBXAccountName

String

No

Yes

The name of the 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

  • PolarDBXAccountNames: the names of the accounts.

  • PolarDBXAccounts: details of the accounts.

Property

Type

Description

Constraint

PolarDBXAccountNames

List

The names of the accounts.

None.

PolarDBXAccounts

List

Details of the accounts.

None.

PolarDBXAccountName

String

The name of the account.

None.

AccountDescription

String

The description of the account.

None.

DBInstanceId

String

The ID of the PolarDB-X instance.

None.

CreateTime

String

The time when the account was created.

None.

AccountType

String

The type of the account.

None.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  PolarDBXAccountName:
    Type: String
    Description:
      en: The username of the account that you want to query. If you want to query information about a specific account, you must specify this parameter.
    Required: false
  DBInstanceId:
    Type: String
    Description:
      en: The ID of the PolarDB-X 2.0 instance.
    Required: true
Resources:
  ExtensionDataSource:
    Type: DATASOURCE::PolarDBX::Accounts
    Properties:
      PolarDBXAccountName:
        Ref: PolarDBXAccountName
      DBInstanceId:
        Ref: DBInstanceId
Outputs:
  PolarDBXAccountNames:
    Description: The list of PolarDB-X 2.0 account names.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - PolarDBXAccountNames
  PolarDBXAccounts:
    Description: The list of PolarDB-X 2.0 accounts.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - PolarDBXAccounts
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "PolarDBXAccountName": {
      "Type": "String",
      "Description": {
        "en": "The username of the account that you want to query. If you want to query information about a specific account, you must specify this parameter."
      },
      "Required": false
    },
    "DBInstanceId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the PolarDB-X 2.0 instance."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::PolarDBX::Accounts",
      "Properties": {
        "PolarDBXAccountName": {
          "Ref": "PolarDBXAccountName"
        },
        "DBInstanceId": {
          "Ref": "DBInstanceId"
        }
      }
    }
  },
  "Outputs": {
    "PolarDBXAccountNames": {
      "Description": "The list of PolarDB-X 2.0 account names.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "PolarDBXAccountNames"
        ]
      }
    },
    "PolarDBXAccounts": {
      "Description": "The list of PolarDB-X 2.0 accounts.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "PolarDBXAccounts"
        ]
      }
    }
  }
}