All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::PolarDBX::Databases

Last Updated:Apr 23, 2025

DATASOURCE::PolarDBX::Databases is used to query PolarDB for Xscale (PolarDB-X) databases.

Syntax

{
  "Type": "DATASOURCE::PolarDBX::Databases",
  "Properties": {
    "DBInstanceId": String,
    "PolarDBXDatabaseName": String,
    "RefreshOptions": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

DBInstanceId

String

Yes

Yes

The ID of the PolarDB-X instance.

None.

PolarDBXDatabaseName

String

No

Yes

The name of the PolarDB-X database.

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

  • PolarDBXDatabaseNames: the names of the PolarDB-X databases.

  • PolarDBXDatabases: details of the PolarDB-X databases.

Property

Type

Description

Constraint

PolarDBXDatabaseNames

List

The names of the PolarDB-X databases.

None.

PolarDBXDatabases

List

Details of the PolarDB-X databases.

None.

DatabaseDescription

String

The description of the PolarDB-X database.

None.

PolarDBXDatabaseName

String

The name of the PolarDB-X database.

None.

CharacterSetName

String

The character set.

None.

Accounts

String

The accounts.

None.

DBInstanceId

String

The ID of the PolarDB-X instance.

None.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  DBInstanceId:
    Type: String
    Description:
      en: The ID of the PolarDB-X 2.0 instance.
    Required: true
  PolarDBXDatabaseName:
    Type: String
    Description:
      en: The name of the PolarDB-X 2.0 instance.
    Required: false
Resources:
  ExtensionDataSource:
    Type: DATASOURCE::PolarDBX::Databases
    Properties:
      DBInstanceId:
        Ref: DBInstanceId
      PolarDBXDatabaseName:
        Ref: PolarDBXDatabaseName
Outputs:
  PolarDBXDatabaseNames:
    Description: The list of PolarDB-X 2.0 database names.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - PolarDBXDatabaseNames
  PolarDBXDatabases:
    Description: The list of PolarDB-X 2.0 databases.
    Value:
      Fn::GetAtt:
        - ExtensionDataSource
        - PolarDBXDatabases
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "DBInstanceId": {
      "Type": "String",
      "Description": {
        "en": "The ID of the PolarDB-X 2.0 instance."
      },
      "Required": true
    },
    "PolarDBXDatabaseName": {
      "Type": "String",
      "Description": {
        "en": "The name of the PolarDB-X 2.0 instance."
      },
      "Required": false
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::PolarDBX::Databases",
      "Properties": {
        "DBInstanceId": {
          "Ref": "DBInstanceId"
        },
        "PolarDBXDatabaseName": {
          "Ref": "PolarDBXDatabaseName"
        }
      }
    }
  },
  "Outputs": {
    "PolarDBXDatabaseNames": {
      "Description": "The list of PolarDB-X 2.0 database names.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "PolarDBXDatabaseNames"
        ]
      }
    },
    "PolarDBXDatabases": {
      "Description": "The list of PolarDB-X 2.0 databases.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "PolarDBXDatabases"
        ]
      }
    }
  }
}