ALIYUN::POLARDB::DBClusterEndpointAddress类型用于创建PolarDB集群的公网地址,包括主地址、默认集群地址和自定义集群地址的公网地址。

语法

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

属性

属性名称 类型 必须 允许更新 描述 约束
DBClusterId String 集群ID。 无。
DBEndpointId String 集群访问地址ID。 您可以调用DescribeDBClusterEndpoints查询集群访问地址ID。
ConnectionStringPrefix String 集群连接地址的前缀。 以字母开头,由小写字母、数字、短划线(-)组成,不能以短划线结尾,长度必须大于6个字符。
NetType String 集群连接地址的网络类型。 取值范围:
  • Public
  • Private

默认值:Public。

返回值

Fn::GetAtt

  • ConnectionString:集群的连接地址。
  • Address:IP地址。

示例

JSON格式

{
  "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 ApsaraDB for POLARDB cluster for which a public connection point is to be created."
    },
    "ConnectionStringPrefix": {
      "AllowedPattern": "[a-z][-a-z0-9]{4,28}[a-z0-9]",
      "Type": "String",
      "Description": "The prefix of the connection string. The prefix must comply with the following rules: It must start with a letter and consist of lowercase letters, digits, and hyphens(-), cannot end with a dash. The length is 6~30 characters."
    },
    "DBEndpointId": {
      "Type": "String",
      "Description": "The ID of the cluster connection point."
    },
    "NetType": {
      "Default": "Public",
      "Type": "String",
      "Description": "The network type of the connection string. If set to Public, ROS will create, modify and delete Public address for you.If set to Private, ROS will only modify Private address for you. Default to Public.",
      "AllowedValues": [
        "Public",
        "Private"
      ]
    }
  },
  "Outputs": {
    "ConnectionString": {
      "Description": "The connection string of the endpoint address.",
      "Value": {
        "Fn::GetAtt": [
          "DBClusterEndpointAddress",
          "ConnectionString"
        ]
      }
    },
    "Address": {
      "Description": "The details of the endpoint address.",
      "Value": {
        "Fn::GetAtt": [
          "DBClusterEndpointAddress",
          "Address"
        ]
      }
    }
  }
}

YAML格式

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 ApsaraDB for POLARDB cluster for which a public connection
      point is to be created.
  ConnectionStringPrefix:
    AllowedPattern: "[a-z][-a-z0-9]{4,28}[a-z0-9]"
    Type: String
    Description: The prefix of the connection string. The prefix must comply with
      the following rules: It must start with a letter and consist of lowercase letters,
      digits, and hyphens (-), cannot end with a dash.The length is 6~30 characters.
  DBEndpointId:
    Type: String
    Description: The ID of the cluster connection point.
  NetType:
    Default: Public
    Type: String
    Description: The network type of the connection string. If set to Public, ROS
      will create, modify and delete Public address for you.If set to Private, ROS
      will only modify Private address for you. Default to Public.
    AllowedValues:
    - Public
    - Private
Outputs:
  ConnectionString:
    Description: The connection string of the endpoint address.
    Value:
      Fn::GetAtt:
      - DBClusterEndpointAddress
      - ConnectionString
  Address:
    Description: The details of the endpoint address.
    Value:
      Fn::GetAtt:
      - DBClusterEndpointAddress
      - Address