DATASOURCE::PolarDBX::Accounts

DATASOURCE::PolarDBX::Accounts类型用于获取PolarDB-X账号列表。

语法

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

属性

属性名称

类型

必须

允许更新

描述

约束

DBInstanceId

String

PolarDB-X实例ID。

AccountType

Integer

账号类型。

取值:

  • 0:普通账号

  • 1:高权限账号

PolarDBXAccountName

String

账号名称。

RefreshOptions

String

当资源栈更新时,数据源资源的刷新策略。

有效值:

  • Never(默认值):更新堆栈时,从不刷新数据源资源。

  • Always:更新堆栈时,始终刷新数据源资源。

返回值

Fn::GetAtt

  • PolarDBXAccountNames:PolarDB-X账号名称列表。

  • PolarDBXAccounts:PolarDB-X账号详情列表。

属性名称

类型

描述

约束

PolarDBXAccountNames

List

PolarDB-X账号名称列表。

PolarDBXAccounts

List

PolarDB-X账号详情列表。

PolarDBXAccountName

String

PolarDB-X账号名称。

AccountDescription

String

账号描述。

DBInstanceId

String

PolarDB-X实例ID。

CreateTime

String

账号创建时间。

AccountType

String

账号类型。

示例

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