ALIYUN::POLARDB::DBClusterEndpointAddress

更新时间:
复制 MD 格式

Creates a public endpoint for a PolarDB cluster, including primary endpoints, default cluster endpoints, and custom cluster endpoints.

Syntax

{
  "Type": "ALIYUN::POLARDB::DBClusterEndpointAddress",
  "Properties": {
    "DBClusterId": String,
    "ConnectionStringPrefix": String,
    "DBEndpointId": String,
    "NetType": String
  }
}

Properties

Property Type Required Update allowed Description Constraints
DBClusterId String Yes No The ID of the cluster. None.
DBEndpointId String Yes No The ID of the cluster endpoint. You can call DescribeDBClusterEndpoints to query the ID of the cluster endpoint.
ConnectionStringPrefix String No Yes The prefix of the cluster endpoint. The prefix must start with a letter and consist of lowercase letters, digits, and hyphens (-). It cannot end with a hyphen. The length must be 6 to 30 characters.
NetType String No No The network type of the cluster endpoint. Valid values:
  • Public
  • Private

Default value: Public.

Return values

Fn::GetAtt

  • ConnectionString: The cluster endpoint.
  • Address: The IP address of the endpoint.

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "DBClusterEndpointAddress": {
      "Type": "ALIYUN::POLARDB::DBClusterEndpointAddress",
      "Properties": {
        "DBClusterId": {
          "Ref": "DBClusterId"
        },
        "ConnectionStringPrefix": {
          "Ref": "ConnectionStringPrefix"
        },
        "DBEndpointId": {
          "Ref": "DBEndpointId"
        },
        "NetType": {
          "Ref": "NetType"
        }
      }
    }
  },
  "Parameters": {
    "DBClusterId": {
      "Type": "String",
      "Description": "The ID of the PolarDB cluster for which to create a public endpoint."
    },
    "ConnectionStringPrefix": {
      "AllowedPattern": "[a-z][-a-z0-9]{4,28}[a-z0-9]",
      "Type": "String",
      "Description": "The prefix of the endpoint. It must start with a letter and can contain lowercase letters, digits, and hyphens (-). It cannot end with a hyphen. The length must be 6 to 30 characters."
    },
    "DBEndpointId": {
      "Type": "String",
      "Description": "The ID of the cluster endpoint."
    },
    "NetType": {
      "Default": "Public",
      "Type": "String",
      "Description": "The network type of the endpoint. If you set this property to Public, ROS creates, modifies, and deletes the public endpoint. If you set this property to Private, ROS only modifies the private endpoint. Default: Public.",
      "AllowedValues": [
        "Public",
        "Private"
      ]
    }
  },
  "Outputs": {
    "ConnectionString": {
      "Description": "The endpoint.",
      "Value": {
        "Fn::GetAtt": [
          "DBClusterEndpointAddress",
          "ConnectionString"
        ]
      }
    },
    "Address": {
      "Description": "The IP address of the endpoint.",
      "Value": {
        "Fn::GetAtt": [
          "DBClusterEndpointAddress",
          "Address"
        ]
      }
    }
  }
}

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Resources:
  DBClusterEndpointAddress:
    Type: ALIYUN::POLARDB::DBClusterEndpointAddress
    Properties:
      DBClusterId:
        Ref: DBClusterId
      ConnectionStringPrefix:
        Ref: ConnectionStringPrefix
      DBEndpointId:
        Ref: DBEndpointId
      NetType:
        Ref: NetType
Parameters:
  DBClusterId:
    Type: String
    Description: The ID of the PolarDB cluster for which to create a public endpoint.
  ConnectionStringPrefix:
    AllowedPattern: '[a-z][-a-z0-9]{4,28}[a-z0-9]'
    Type: String
    Description: 'The prefix of the endpoint. It must start with a letter and can contain lowercase letters, digits, and hyphens (-). It cannot end with a hyphen. The length must be 6 to 30 characters.'
  DBEndpointId:
    Type: String
    Description: The ID of the cluster endpoint.
  NetType:
    Default: Public
    Type: String
    Description: The network type of the endpoint. If you set this property to Public, ROS creates, modifies, and deletes the public endpoint. If you set this property to Private, ROS only modifies the private endpoint. Default: Public.
    AllowedValues:
      - Public
      - Private
Outputs:
  ConnectionString:
    Description: The endpoint.
    Value:
      Fn::GetAtt:
        - DBClusterEndpointAddress
        - ConnectionString
  Address:
    Description: The IP address of the endpoint.
    Value:
      Fn::GetAtt:
        - DBClusterEndpointAddress
        - Address