DATASOURCE::POLARDB::DBClusters is used to query the details of PolarDB clusters.

Syntax

{
  "Type": "DATASOURCE::POLARDB::DBClusters",
  "Properties": {
    "Description": String,
    "DbVersion": String,
    "ResourceGroupId": String,
    "DbClusterId": String,
    "Expired": String,
    "DbType": String
  }
}

Properties

PropertyTypeRequiredEditableDescriptionConstraint
DescriptionStringNoYesThe description of the cluster. None.
DbVersionStringNoYesThe database engine version of the cluster. Valid values:
  • 5.6
  • 5.7
  • 8.0
  • 11
  • 14
ResourceGroupIdStringNoYesThe ID of the resource group. None.
DbClusterIdStringNoYesThe cluster ID. None.
ExpiredStringNoYesSpecifies whether the cluster has expired. Valid values:
  • true: The cluster has expired.
  • false: The cluster has not expired.
DbTypeStringNoYesThe database engine type of the cluster. None.

Return values

Fn::GetAtt

  • DbClusterIds: the cluster IDs.
  • DBClusters: details of the clusters.
PropertyTypeDescriptionConstraint
DbClusterIdsListThe cluster IDs. None.
DBClustersListDetails of the clusters. None.
CategoryStringThe edition of the cluster. Valid values:
  • Normal: Cluster Edition
  • Basic: Single Node Edition
  • Archive: X-Engine
  • NormalMultimaster: Multi-master Cluster (Database/Table) Edition
LockModeStringThe lock mode of the cluster. Valid values:
  • Unlock: The cluster is not locked.
  • ManualLock: The cluster is manually locked.
  • LockByExpiration: The cluster is automatically locked after the cluster expires.
DeletionLockStringIndicates whether the cluster is locked and can be deleted. Valid values:
  • 0: The cluster is not locked.
  • 1: The cluster is locked.
Note If the cluster is locked, you cannot delete the cluster.
DbClusterIdStringThe cluster ID. None.
VpcIdStringThe ID of the virtual private cloud (VPC). None.
DescriptionStringThe description of the cluster. None.
TagsListThe tags of the cluster. Example:
[ {
      "Key" : "MySQL",
      "Value" : "5.6"
    } ]
ClusterNetworkTypeStringThe network type of the cluster. None.
RegionIdStringThe region ID. None.
ResourceGroupIdStringThe ID of the resource group. None.
DbNodesListDetails of the nodes. Example:
[ {
      "DBNodeClass" : "polar.mysql.x4.large",
      "ZoneId" : "cn-hangzhou-i",
      "DBNodeRole" : "Reader",
      "DBNodeId" : "pi-****************",
      "RegionId" : "cn-hangzhou"
    } ]
DbNodeClassStringThe instance type of the node. None.
ExpiredStringIndicates whether the cluster has expired. Valid values:
  • true: The cluster has expired.
  • false: The cluster has not expired.
Note This property is returned if PaymentType is set to Prepaid.
StatusStringThe state of the cluster. None.
DbVersionStringThe database engine version of the cluster. None.
ZoneIdStringThe zone ID. None.
StorageUsedStringThe storage space that is consumed by the cluster. Unit: bytes.
EngineStringThe database type. None.
StorageSpaceStringThe storage space that uses the subscription billing method. Unit: bytes.
DbTypeStringThe database engine type of the cluster. None.
DbNodeNumberIntegerThe number of nodes. None.
ExpireTimeStringThe time when the cluster expired.
  • A specific value is returned if PaymentType is set to Prepaid.
  • An empty string is returned if PaymentType is set to Postpaid.
PaymentTypeStringThe billing method of the cluster. Valid values:
  • Postpaid: pay-as-you-go
  • Prepaid: subscription
CreateTimeStringThe time when the cluster was created. None.

Examples

  • YAML format

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters: {}
    Resources:
      ExtensionDataSource:
        Type: DATASOURCE::POLARDB::DBClusters
        Properties:
          DbVersion: '5.7'
    Outputs:
      DbClusterIds:
        Description: The ID of the cluster.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - DbClusterIds
      DBClusters:
        Description: The list of db clusters.
        Value:
          Fn::GetAtt:
            - ExtensionDataSource
            - DBClusters
  • JSON format

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
      },
      "Resources": {
        "ExtensionDataSource": {
          "Type": "DATASOURCE::POLARDB::DBClusters",
          "Properties": {
            "DbVersion": "5.7"
          }
        }
      },
      "Outputs": {
        "DbClusterIds": {
          "Description": "The ID of the cluster.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "DbClusterIds"
            ]
          }
        },
        "DBClusters": {
          "Description": "The list of db clusters.",
          "Value": {
            "Fn::GetAtt": [
              "ExtensionDataSource",
              "DBClusters"
            ]
          }
        }
      }
    }