ALIYUN::GA::EndpointGroup类型用于创建终端节点组。

语法

{
  "Type": "ALIYUN::GA::EndpointGroup",
  "Properties": {
    "HealthCheckIntervalSeconds": Integer,
    "EndpointGroupRegion": String,
    "TrafficPercentage": Integer,
    "Description": String,
    "HealthCheckPath": String,
    "HealthCheckProtocol": String,
    "ThresholdCount": Integer,
    "HealthCheckPort": Integer,
    "AcceleratorId": String,
    "EndpointConfigurations": List,
    "Name": String,
    "ListenerId": String
  }
}

属性

属性名称 类型 必须 允许更新 描述 约束
HealthCheckIntervalSeconds Integer 健康检查的时间间隔。 单位:秒。
EndpointGroupRegion String 终端节点组所属的地域。
TrafficPercentage Integer 监听有多个终端节点组时的权重。
Description String 终端节点组描述信息。
HealthCheckPath String 健康检查路径。
HealthCheckProtocol String 健康检查的协议。 取值:
  • tcp:TCP协议。
  • http:HTTP协议。
  • https:HTTPS协议。
ThresholdCount Integer 健康检查判定终端节点为不健康的次数。
HealthCheckPort Integer 健康检查的端口。
AcceleratorId String 全球加速实例ID。
EndpointConfigurations List 终端节点。 最多设置4个终端节点。

详情请参见EndpointConfigurations属性

Name String 终端节点组的名称。
ListenerId String 监听ID。

EndpointConfigurations语法

"EndpointConfigurations": [
  {
    "Type": String,
    "Endpoint": String,
    "Weight": Integer
  }
]

EndpointConfigurations属性

属性名称 类型 必须 允许更新 描述 约束
Type String 终端节点类型。 取值:
  • Domain:自定义域名。
  • Ip:自定义IP。
Endpoint String 终端节点的IP或域名。
Weight Integer 终端节点的权重。

返回值

Fn::GetAtt

EndpointGroupId:终端节点组ID。

示例

JSON格式

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "HealthCheckIntervalSeconds": {
      "Type": "Number",
      "Description": "The interval between two consecutive health checks. Unit: seconds."
    },
    "EndpointGroupRegion": {
      "Type": "String",
      "Description": "The region ID of the endpoint group."
    },
    "TrafficPercentage": {
      "Type": "Number",
      "Description": "The weight of the endpoint group when the corresponding listener is associated with\nmultiple endpoint groups."
    },
    "Description": {
      "Type": "String",
      "Description": "The description of the endpoint group."
    },
    "HealthCheckPath": {
      "Type": "String",
      "Description": "The path set as the destination on the targets for health checks."
    },
    "HealthCheckProtocol": {
      "Type": "String",
      "Description": "The protocol that is used to connect with the targets for health checks.\ntcp: TCP protocol\nhttp: HTTP protocol\nhttps: HTTPS protocol",
      "AllowedValues": [
        "tcp",
        "http",
        "https"
      ]
    },
    "ThresholdCount": {
      "Type": "Number",
      "Description": "The number of consecutive failed heath checks that must occur before declaring an endpoint unhealthy."
    },
    "HealthCheckPort": {
      "Type": "Number",
      "Description": "The port that is used to connect with the targets for health checks."
    },
    "AcceleratorId": {
      "Type": "String",
      "Description": "The ID of the Global Accelerator instance with which the endpoint group will be associated."
    },
    "EndpointConfigurations": {
      "Type": "Json",
      "Description": "",
      "MinLength": 1,
      "MaxLength": 4
    },
    "Name": {
      "Type": "String",
      "Description": "The name of the endpoint group."
    },
    "ListenerId": {
      "Type": "String",
      "Description": "The ID of the listener to be associated with the endpoint group."
    }
  },
  "Resources": {
    "EndpointGroup": {
      "Type": "ALIYUN::GA::EndpointGroup",
      "Properties": {
        "HealthCheckIntervalSeconds": {
          "Ref": "HealthCheckIntervalSeconds"
        },
        "EndpointGroupRegion": {
          "Ref": "EndpointGroupRegion"
        },
        "TrafficPercentage": {
          "Ref": "TrafficPercentage"
        },
        "Description": {
          "Ref": "Description"
        },
        "HealthCheckPath": {
          "Ref": "HealthCheckPath"
        },
        "HealthCheckProtocol": {
          "Ref": "HealthCheckProtocol"
        },
        "ThresholdCount": {
          "Ref": "ThresholdCount"
        },
        "HealthCheckPort": {
          "Ref": "HealthCheckPort"
        },
        "AcceleratorId": {
          "Ref": "AcceleratorId"
        },
        "EndpointConfigurations": {
          "Ref": "EndpointConfigurations"
        },
        "Name": {
          "Ref": "Name"
        },
        "ListenerId": {
          "Ref": "ListenerId"
        }
      }
    }
  },
  "Outputs": {
    "EndpointGroupId": {
      "Description": "The ID of the endpoint group.",
      "Value": {
        "Fn::GetAtt": [
          "EndpointGroup",
          "EndpointGroupId"
        ]
      }
    }
  }
}

YAML格式

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  HealthCheckIntervalSeconds:
    Type: Number
    Description: 'The interval between two consecutive health checks. Unit: seconds.'
  EndpointGroupRegion:
    Type: String
    Description: The region ID of the endpoint group.
  TrafficPercentage:
    Type: Number
    Description: >-
      The weight of the endpoint group when the corresponding listener is
      associated with

      multiple endpoint groups.
  Description:
    Type: String
    Description: The description of the endpoint group.
  HealthCheckPath:
    Type: String
    Description: The path set as the destination on the targets for health checks.
  HealthCheckProtocol:
    Type: String
    Description: |-
      The protocol that is used to connect with the targets for health checks.
      tcp: TCP protocol
      http: HTTP protocol
      https: HTTPS protocol
    AllowedValues:
      - tcp
      - http
      - https
  ThresholdCount:
    Type: Number
    Description: >-
      The number of consecutive failed heath checks that must occur before
      declaring an endpoint unhealthy.
  HealthCheckPort:
    Type: Number
    Description: The port that is used to connect with the targets for health checks.
  AcceleratorId:
    Type: String
    Description: >-
      The ID of the Global Accelerator instance with which the endpoint group
      will be associated.
  EndpointConfigurations:
    Type: Json
    Description: ''
    MinLength: 1
    MaxLength: 4
  Name:
    Type: String
    Description: The name of the endpoint group.
  ListenerId:
    Type: String
    Description: The ID of the listener to be associated with the endpoint group.
Resources:
  EndpointGroup:
    Type: 'ALIYUN::GA::EndpointGroup'
    Properties:
      HealthCheckIntervalSeconds:
        Ref: HealthCheckIntervalSeconds
      EndpointGroupRegion:
        Ref: EndpointGroupRegion
      TrafficPercentage:
        Ref: TrafficPercentage
      Description:
        Ref: Description
      HealthCheckPath:
        Ref: HealthCheckPath
      HealthCheckProtocol:
        Ref: HealthCheckProtocol
      ThresholdCount:
        Ref: ThresholdCount
      HealthCheckPort:
        Ref: HealthCheckPort
      AcceleratorId:
        Ref: AcceleratorId
      EndpointConfigurations:
        Ref: EndpointConfigurations
      Name:
        Ref: Name
      ListenerId:
        Ref: ListenerId
Outputs:
  EndpointGroupId:
    Description: The ID of the endpoint group.
    Value:
      'Fn::GetAtt':
        - EndpointGroup
        - EndpointGroupId