ALIYUN::POLARDB::DBClusterEndpoint

更新时间:
复制 MD 格式

The ALIYUN::POLARDB::DBClusterEndpoint type creates a custom cluster endpoint for PolarDB.

Syntax

{
  "Type": "ALIYUN::POLARDB::DBClusterEndpoint",
  "Properties": {
    "DBClusterId": String,
    "ReadWriteMode": String,
    "EndpointType": String,
    "AutoAddNewNodes": String,
    "Nodes": List,
    "EndpointConfig": Map
  }
}

Properties

Property Name

Type

Required

Update allowed

Description

Constraints

DBClusterId

String

Yes

No

The cluster ID.

None

ReadWriteMode

String

No

Yes

The read/write mode.

Valid values:

  • ReadWrite: read-write mode with automatic read/write splitting.

  • ReadOnly (default): read-only mode.

EndpointType

String

No

No

The type of the custom cluster endpoint.

Valid value: Custom.

AutoAddNewNodes

String

No

Yes

Specifies whether to automatically add new nodes to the custom cluster endpoint.

Valid values:

  • Enable

  • Disable (default)

Nodes

List

No

Yes

The nodes that process read requests.

Example: ["pi-bpsg35x****", "pi-bp3ddh****"].

The value must contain at least two nodes. The default value is all nodes.

EndpointConfig

Map

No

Yes

Consistency level

For more information, see EndpointConfig properties.

EndpointConfig syntax

"EndpointConfig": {
  "ConsistLevel": String,
  "ConsistTimeout": String,
  "LoadBalancePolicy": String,
  "ConnectionPersist": String,
  "DistributedTransaction": String,
  "EnableOverloadThrottle": String,
  "MasterAcceptReads": String,
  "ConsistTimeoutAction": String,
  "EnableHtapImci": String,
  "MaxParallelDegree": String
}  

EndpointConfig properties

Property Name

Type

Required

Update allowed

Description

Constraints

ConsistLevel

String

No

Yes

The consistency level.

Valid values:

  • 0: eventual consistency

    Note

    If you set the ReadWriteMode parameter to ReadOnly, the consistency level can only be 0.

  • 1 (default): session consistency

ConsistTimeout

String

No

Yes

The timeout for global consistency read.

None

LoadBalancePolicy

String

No

Yes

You can set the load balancing policy.

Format: {"LoadBalancePolicy":"load balancing policy"}.

Valid values:

  • 0: load balancing based on the number of connections (default).

  • 1: load balancing based on the number of active requests.

ConnectionPersist

String

No

Yes

You can set the connection pool.

Format: {"ConsistLevel":"connection pool"}.

Valid values:

  • off: disables the connection pool (default).

  • Session: enables the session-level connection pool.

  • Transaction: enables transaction-level connection pooling.

DistributedTransaction

String

No

Yes

The transaction splitting setting.

Format: {"DistributedTransaction":"transaction splitting"}.

Valid values:

  • on: enables transaction splitting (default).

  • off: disables transaction splitting.

EnableOverloadThrottle

String

No

Yes

Specifies whether to enable overload protection.

The format is {"EnableOverloadThrottle":"Whether to enable overload protection"}.

Valid values:

  • on: enables overload protection.

  • off: disables overload protection (default).

MasterAcceptReads

String

No

Yes

Specifies whether the primary node accepts read requests.

Format: {"MasterAcceptReads":"master read acceptance"}.

Valid values:

  • on: The primary node accepts read requests.

  • off: The primary node does not accept read requests (default).

ConsistTimeoutAction

String

No

Yes

The policy for handling global consistency read timeouts.

Valid values:

  • 0: The request is sent to the primary node (default).

  • 1: An SQL error is reported.

EnableHtapImci

String

No

Yes

Specifies whether to enable automatic traffic steering between the row store and column store.

Format: {"EnableHtapImci":"row/column store traffic steering"}.

Valid values:

  • on: enables automatic traffic steering between the row store and column store.

  • off: disables automatic traffic steering between the row store and column store (default).

MaxParallelDegree

String

No

Yes

You can configure a parallel query.

Format: {"MaxParallelDegree":"parallel query"}.

Valid values:

  • on: enables parallel query.

  • off: disables parallel query (default).

Return values

Fn::GetAtt

  • DBEndpointId: The ID of the cluster endpoint.

  • ConnectionString: The connection string.

  • Addresses: The IP addresses.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  DBClusterEndpoint:
    Type: ALIYUN::POLARDB::DBClusterEndpoint
    Properties:
      DBClusterId:
        Ref: DBClusterId
      ReadWriteMode:
        Ref: ReadWriteMode
      EndpointConfig:
        Ref: EndpointConfig
      AutoAddNewNodes:
        Ref: AutoAddNewNodes
      Nodes:
        Fn::Split:
        - ","
        - Ref: Nodes
      EndpointType:
        Ref: EndpointType
Parameters:
  DBClusterId:
    Type: String
    Description: The ID of the ApsaraDB for POLARDB cluster for which a custom connection
      point is to be created.
  ReadWriteMode:
    Default: ReadOnly
    Type: String
    Description: 'The read/write mode of the cluster connection point. Valid values:ReadWrite:
      receives and forwards read and write requests (automatic read-write splitting).ReadOnly:
      receives and forwards only read requests.Default value: ReadOnly.'
    AllowedValues:
    - ReadOnly
    - ReadWrite
  EndpointConfig:
    Type: Json
    Description: ''
  AutoAddNewNodes:
    Default: Disable
    Type: String
    Description: |-
      Specifies whether a newly added node is automatically added to this connection point.
      Valid values: Enable, Disable.
      Default value: Disable.
    AllowedValues:
    - Disable
    - Enable
  Nodes:
    MinLength: 2
    Type: CommaDelimitedList
    Description: |-
      The nodes to be added to this connection point to process read requests from this connection point. Add at least two nodes.
      If you do not specify this parameter, all nodes of the cluster are added to this connection point by default.
  EndpointType:
    Default: Custom
    Type: String
    Description: The type of the cluster connection point. Set this parameter to Custom.
Outputs:
  DBEndpointId:
    Description: DB cluster endpoint ID. E.g. pe-xxxxxxxx.
    Value:
      Fn::GetAtt:
      - DBClusterEndpoint
      - DBEndpointId
  ConnectionString:
    Description: The first connection string of the db cluster endpoint.
    Value:
      Fn::GetAtt:
      - DBClusterEndpoint
      - ConnectionString
  Addresses:
    Description: The address items of the db cluster endpoint.
    Value:
      Fn::GetAtt:
      - DBClusterEndpoint
      - Addresses

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "DBClusterEndpoint": {
      "Type": "ALIYUN::POLARDB::DBClusterEndpoint",
      "Properties": {
        "DBClusterId": {
          "Ref": "DBClusterId"
        },
        "ReadWriteMode": {
          "Ref": "ReadWriteMode"
        },
        "EndpointConfig": {
          "Ref": "EndpointConfig"
        },
        "AutoAddNewNodes": {
          "Ref": "AutoAddNewNodes"
        },
        "Nodes": {
          "Fn::Split": [
            ",",
            {
              "Ref": "Nodes"
            }
          ]
        },
        "EndpointType": {
          "Ref": "EndpointType"
        }
      }
    }
  },
  "Parameters": {
    "DBClusterId": {
      "Type": "String",
      "Description": "The ID of the ApsaraDB for POLARDB cluster for which a custom connection point is to be created."
    },
    "ReadWriteMode": {
      "Default": "ReadOnly",
      "Type": "String",
      "Description": "The read/write mode of the cluster connection point. Valid values: ReadWrite: receives and forwards read and write requests (automatic read-write splitting). ReadOnly: receives and forwards only read requests. Default value: ReadOnly.",
      "AllowedValues": [
        "ReadOnly",
        "ReadWrite"
      ]
    },
    "EndpointConfig": {
      "Type": "Json",
      "Description": ""
    },
    "AutoAddNewNodes": {
      "Default": "Disable",
      "Type": "String",
      "Description": "Specifies whether a newly added node is automatically added to this connection point.\nValid values: Enable, Disable.\nDefault value: Disable.",
      "AllowedValues": [
        "Disable",
        "Enable"
      ]
    },
    "Nodes": {
      "MinLength": 2,
      "Type": "CommaDelimitedList",
      "Description": "The nodes to be added to this connection point to process read requests from this connection point. Add at least two nodes.\nIf you do not specify this parameter, all nodes of the cluster are added to this connection point by default."
    },
    "EndpointType": {
      "Default": "Custom",
      "Type": "String",
      "Description": "The type of the cluster connection point. Set this parameter to Custom."
    }
  },
  "Outputs": {
    "DBEndpointId": {
      "Description": "DB cluster endpoint ID. E.g. pe-xxxxxxxx.",
      "Value": {
        "Fn::GetAtt": [
          "DBClusterEndpoint",
          "DBEndpointId"
        ]
      }
    },
    "ConnectionString": {
      "Description": "The first connection string of the db cluster endpoint.",
      "Value": {
        "Fn::GetAtt": [
          "DBClusterEndpoint",
          "ConnectionString"
        ]
      }
    },
    "Addresses": {
      "Description": "The address items of the db cluster endpoint.",
      "Value": {
        "Fn::GetAtt": [
          "DBClusterEndpoint",
          "Addresses"
        ]
      }
    }
  }
}