ALIYUN::GWLB::ServerGroup类型用于创建服务器组。
语法
{
"Type": "ALIYUN::GWLB::ServerGroup",
"Properties": {
"VpcId": String,
"ConnectionDrainConfig": Map,
"HealthCheckConfig": Map,
"Protocol": String,
"ResourceGroupId": String,
"Scheduler": String,
"Servers": List,
"ServerGroupType": String,
"ServerGroupName": String,
"Tags": List
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
VpcId | String | 是 | 否 | VPC 实例 ID。 | 说明 如果 ServerGroupType 取值为 Instance 时,只有该 VPC 下的服务器可以加入到该服务器组。 |
ConnectionDrainConfig | Map | 否 | 是 | 连接优雅中断相关配置。 | 更多信息,请参考ConnectionDrainConfig属性。 |
HealthCheckConfig | Map | 否 | 是 | 健康检查相关配置。 | 更多信息,请参考HealthCheckConfig属性。 |
Protocol | String | 否 | 否 | 后端转发协议。 | 取值:
|
ResourceGroupId | String | 否 | 否 | 资源组 ID。 | 无 |
Scheduler | String | 否 | 是 | 调度算法。 | 取值:
|
Servers | List | 否 | 是 | 后端服务器列表。 | 更多信息,请参考Servers属性。 |
ServerGroupType | String | 否 | 否 | 服务器组类型。 | 取值:
|
ServerGroupName | String | 否 | 是 | 服务器组名称。 | 长度为 2~128 个字符,必须以大小写字母或中文开头,可包含数字、半角句号(.)、下划线(_)和短划线(-)。 |
Tags | List | 否 | 是 | 自定义标签。 | 更多信息,请参考Tags属性。 |
ConnectionDrainConfig语法
"ConnectionDrainConfig": {
"ConnectionDrainEnabled": Boolean,
"ConnectionDrainTimeout": Integer
}
ConnectionDrainConfig属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
ConnectionDrainEnabled | Boolean | 否 | 是 | 是否开启连接优雅中断。 | 取值:
|
ConnectionDrainTimeout | Integer | 否 | 是 | 连接优雅中断超时时间。 | 单位:秒。 取值范围:1~3600。 默认值:300。 |
HealthCheckConfig语法
"HealthCheckConfig": {
"HealthCheckInterval": Integer,
"HealthCheckConnectPort": Integer,
"UnhealthyThreshold": Integer,
"HealthyThreshold": Integer,
"HealthCheckPath": String,
"HealthCheckProtocol": String,
"HealthCheckConnectTimeout": Integer,
"HealthCheckDomain": String,
"HealthCheckEnabled": Boolean,
"HealthCheckHttpCode": List
}
HealthCheckConfig属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
HealthCheckInterval | Integer | 否 | 是 | 健康检查的时间间隔。 | 单位:秒。 取值范围:1~50。 默认值:10。 |
HealthCheckConnectPort | Integer | 否 | 是 | 健康检查使用的后端服务器的端口。 | 取值范围: 1~65535。 默认值:80。 |
HealthyThreshold | Integer | 否 | 是 | 健康检查连续成功多少次后,将后端服务器的健康检查状态由失败判定为成功。 | 取值范围:2~10。 默认值:2。 |
HealthCheckPath | String | 否 | 是 | 健康检查路径。 | 长度为 1~80 个字符,只能使用大小写英文字母、数字和短划线(-)、正斜线(/)、半角句号(.)、百分号(%)、半角问号(?)、井号(#)和 and(&)以及扩展字符集_;~!()*[]@$^:',+= 必须以正斜线(/)开头。 说明 仅 HealthCheckProtocol 为 HTTP 时,该参数生效。 |
HealthCheckProtocol | String | 否 | 是 | 健康检查协议。 | 取值:
|
HealthCheckConnectTimeout | Integer | 否 | 是 | 健康检查响应的最大超时时间。 | 单位:秒。 取值范围:1~300。 默认值:5。 |
HealthCheckDomain | String | 否 | 是 | 用于健康检查的域名。 | 取值:
说明 仅 HealthCheckProtocol 为 HTTP 时,该参数生效。 |
HealthCheckEnabled | Boolean | 否 | 是 | 是否开启健康检查。 | 取值:
|
HealthCheckHttpCode | List | 否 | 是 | 健康状态返回码列表。 | 健康状态返回码, 取值:
说明 仅 HealthCheckProtocol 为 HTTP 时,该参数生效。 |
UnhealthyThreshold | Integer | 否 | 是 | 健康检查连续失败多少次后,将后端服务器的健康检查状态由成功判定为失败。 | 取值范围:2~10。 默认值:2。 |
Servers语法
"Servers": [
{
"ServerType": String,
"ServerId": String,
"Port": Integer,
"ServerIp": String
}
]
Servers属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
ServerType | String | 是 | 是 | 后端服务器类型。 | 取值:
|
ServerId | String | 是 | 是 | 后端服务器 ID。 | 无 |
Port | Integer | 否 | 否 | 后端服务器使用的端口。 | 取值:
|
ServerIp | String | 否 | 是 | 后端服务器 IP 地址。 | 无 |
Tags语法
"Tags": [
{
"Value": String,
"Key": String
}
]
Tags属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
Key | String | 是 | 否 | 标签键。 | 无 |
Value | String | 否 | 否 | 标签值。 | 无 |
返回值
Fn::GetAtt
ConnectionDrainConfig:连接优雅中断相关配置。
VpcId:专有网络 ID。
ResourceGroupId:资源组 ID。
Scheduler:调度算法。
CreateTime:资源创建时间。
ServerGroupId:服务器组 ID。
HealthCheckConfig:健康检查相关配置。
Protocol:后端转发协议。
Servers:后端服务器列表。
ServerGroupType:服务器组类型。
Tags:自定义标签列表。
ServerGroupName:服务器组名称。
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
VpcId:
AssociationProperty: ALIYUN::ECS::VPC::VPCId
Type: String
Description:
en: |-
The VPC instance ID.
> If the value of ServerGroupType is Instance, only servers in the VPC can be added to the server group.
Required: true
Resources:
ExtensionResource:
Type: ALIYUN::GWLB::ServerGroup
Properties:
VpcId:
Ref: VpcId
Outputs:
ConnectionDrainConfig:
Description: Connected graceful interrupt configuration.
Value:
Fn::GetAtt:
- ExtensionResource
- ConnectionDrainConfig
VpcId:
Description: The VPC instance ID.
Value:
Fn::GetAtt:
- ExtensionResource
- VpcId
ResourceGroupId:
Description: The ID of the resource group.
Value:
Fn::GetAtt:
- ExtensionResource
- ResourceGroupId
Scheduler:
Description: Scheduling algorithm.
Value:
Fn::GetAtt:
- ExtensionResource
- Scheduler
CreateTime:
Description: The creation time of the server group.
Value:
Fn::GetAtt:
- ExtensionResource
- CreateTime
ServerGroupId:
Description: The server group ID.
Value:
Fn::GetAtt:
- ExtensionResource
- ServerGroupId
HealthCheckConfig:
Description: Health check configurations.
Value:
Fn::GetAtt:
- ExtensionResource
- HealthCheckConfig
Protocol:
Description: Backend Protocol.
Value:
Fn::GetAtt:
- ExtensionResource
- Protocol
Servers:
Description: List of servers.
Value:
Fn::GetAtt:
- ExtensionResource
- Servers
ServerGroupType:
Description: The server group type.
Value:
Fn::GetAtt:
- ExtensionResource
- ServerGroupType
Tags:
Description: List of resource tags.
Value:
Fn::GetAtt:
- ExtensionResource
- Tags
ServerGroupName:
Description: The server group name.
Value:
Fn::GetAtt:
- ExtensionResource
- ServerGroupName
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"VpcId": {
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
"Type": "String",
"Description": {
"en": "The VPC instance ID.\n> If the value of ServerGroupType is Instance, only servers in the VPC can be added to the server group."
},
"Required": true
}
},
"Resources": {
"ExtensionResource": {
"Type": "ALIYUN::GWLB::ServerGroup",
"Properties": {
"VpcId": {
"Ref": "VpcId"
}
}
}
},
"Outputs": {
"ConnectionDrainConfig": {
"Description": "Connected graceful interrupt configuration.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"ConnectionDrainConfig"
]
}
},
"VpcId": {
"Description": "The VPC instance ID.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"VpcId"
]
}
},
"ResourceGroupId": {
"Description": "The ID of the resource group.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"ResourceGroupId"
]
}
},
"Scheduler": {
"Description": "Scheduling algorithm.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Scheduler"
]
}
},
"CreateTime": {
"Description": "The creation time of the server group.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"CreateTime"
]
}
},
"ServerGroupId": {
"Description": "The server group ID.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"ServerGroupId"
]
}
},
"HealthCheckConfig": {
"Description": "Health check configurations.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"HealthCheckConfig"
]
}
},
"Protocol": {
"Description": "Backend Protocol.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Protocol"
]
}
},
"Servers": {
"Description": "List of servers.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Servers"
]
}
},
"ServerGroupType": {
"Description": "The server group type.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"ServerGroupType"
]
}
},
"Tags": {
"Description": "List of resource tags.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"Tags"
]
}
},
"ServerGroupName": {
"Description": "The server group name.",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"ServerGroupName"
]
}
}
}
}