ALIYUN::NLB::ServerGroup is used to create a server group for a Network Load Balancer (NLB) instance.
Syntax
{
"Type": "ALIYUN::NLB::ServerGroup",
"Properties": {
"ResourceGroupId": String,
"Scheduler": String,
"AddressIPVersion": String,
"Servers": List,
"PreserveClientIpEnabled": Boolean,
"ServerGroupType": String,
"PersistenceEnabled": Boolean,
"ConnectionDrainEnabled": Boolean,
"ConnectionDrainTimeout": Integer,
"PersistenceTimeout": Integer,
"VpcId": String,
"HealthCheckConfig": Map,
"Protocol": String,
"ServerGroupName": String,
"Tags": List,
"AnyPortEnabled": Boolean
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
ResourceGroupId | String | No | No | The ID of the resource group. | None. |
Scheduler | String | No | No | The scheduling algorithm. | Valid values:
|
AddressIPVersion | String | No | No | The IP version. | Valid values:
|
Servers | List | No | No | The servers. | For more information, see Servers properties. |
PreserveClientIpEnabled | Boolean | No | No | Specifies whether to enable client IP preservation. | Valid values:
|
ServerGroupType | String | No | No | The type of the server group. | Valid values:
|
PersistenceEnabled | Boolean | No | No | Specifies whether to enable session persistence. | Valid values:
|
ConnectionDrainEnabled | Boolean | No | No | Specifies whether to enable connection draining. | Valid values:
|
ConnectionDrainTimeout | Integer | No | No | The timeout period of connection draining. | Unit: seconds. Valid values: 10 to 900. |
PersistenceTimeout | Integer | No | No | The timeout period of session persistence. | Unit: seconds. Valid values: 0 to 3600. |
VpcId | String | Yes | No | The ID of the virtual private cloud (VPC) to which the server group belongs. | Note When you set ServerGroupType to Instance, you can add servers to the server group only if the servers and the server group are in the same VPC. |
HealthCheckConfig | Map | No | No | The configurations of the health check feature. | For more information, see HealthCheckConfig properties. |
Protocol | String | No | No | The backend protocol. | Valid values:
|
ServerGroupName | String | Yes | No | The name of the server group. | The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter. |
AnyPortEnabled | Boolean | No | No | Specifies whether to enable multi-port forwarding. | Valid values:
|
Tags | List | No | Yes | The tags. | For more information, see Tags properties. |
Servers syntax
"Servers": [
{
"ServerType": String,
"Description": String,
"ServerId": String,
"ServerIp": String,
"Port": Integer,
"Weight": Integer
}
]
Servers properties
Property | Type | Required | Editable | Description | Constraint |
ServerType | String | Yes | No | The type of the backend server. | Valid values:
|
Description | String | No | No | The description of the backend server. | None. |
ServerId | String | Yes | No | The ID of the instance that you want to use as the backend server. | Valid values:
Note You must specify ServerType when ServerId is set to the ID of the ENI or elastic container instance. |
ServerIp | String | No | No | The IP address of the ECS instance, ENI, or elastic container instance. | None. |
Port | Integer | No | No | The backend port that you want to use to receive requests. | None. |
Weight | Integer | No | No | The weight of the backend server. | Valid values: 0 to 100. Default value: 100. |
HealthCheckConfig syntax
"HealthCheckConfig": {
"HealthCheckInterval": Integer,
"HealthCheckUrl": String,
"HealthCheckConnectPort": Integer,
"UnhealthyThreshold": Integer,
"HttpCheckMethod": String,
"HealthyThreshold": Integer,
"HealthCheckConnectTimeout": Integer,
"HealthCheckDomain": String,
"HealthCheckEnabled": Boolean,
"HealthCheckHttpCode": List,
"HealthCheckType": String
}
HealthCheckConfig properties
Property | Type | Required | Editable | Description | Constraint |
HealthCheckInterval | Integer | No | No | The interval between two consecutive health checks. | Unit: seconds. Valid values: 5 to 50. Default value: 10. |
HealthCheckUrl | String | No | No | The path based on which the system performs health checks. | The path must be 1 to 80 characters in length, and can contain only letters, digits, the - / . % ? # & = special characters, and the _ ; ~ ! ( ) * [ ] @ $ ^ : ' , + extended characters. It must start with a forward slash (/). Note This property takes effect when HealthCheckType is set to Http. |
HealthCheckConnectPort | Integer | No | No | The backend port that you want to use for health checks. | Valid values: 0 to 65535. Default value: 0. A value of 0 indicates that the port of a backend server is used for health checks. |
UnhealthyThreshold | Integer | No | No | The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. | Valid values: 2 to 10. Default value: 2. |
HttpCheckMethod | String | Yes | No | The method that you want to use for health checks. | Valid values:
Note This property takes effect when HealthCheckType is set to Http. |
HealthyThreshold | Integer | No | No | The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. | Valid values: 2 to 10. Default value: 2. |
HealthCheckConnectTimeout | Integer | No | No | The maximum timeout period of a health check response. | Unit: seconds. Valid values: 1 to 300. Default value: 5. |
HealthCheckDomain | String | No | No | The domain name that you want to use for health checks. | Valid values:
Note This property takes effect when HealthCheckType is set to Http. |
HealthCheckEnabled | Boolean | No | No | Specifies whether to enable the health check feature. | Valid values:
|
HealthCheckHttpCode | List | No | No | The HTTP status codes that the system returns for health checks. | Separate multiple HTTP status codes with commas (,). Valid values:
Note This property takes effect when HealthCheckType is set to Http. |
HealthCheckType | String | No | No | The protocol that you want to use for health checks. | Valid values:
|
Tags syntax
"Tags": [
{
"Key": String,
"Value": String
}
]
Tags properties
Property | Type | Required | Editable | Description | Constraint |
Key | String | Yes | No | The tag key. | None. |
Value | String | No | No | The tag value. | None. |
Return values
Fn::GetAtt
ServerGroupId: the ID of the server group.
Examples
The following section provides examples on how to create a server group that is associated with a specified IP address.
YAML format
ROSTemplateFormatVersion: '2015-09-01'
Description: ''
Parameters:
VpcId:
Type: String
AssociationProperty: ALIYUN::ECS::VPC::VPCId
Resources:
NlbServerGroup:
Type: ALIYUN::NLB::ServerGroup
Properties:
Servers:
- ServerId: 10.1.1.102
ServerIp: 10.1.1.102
Port: 80
Weight: 100
ServerType: Ip
ServerGroupType: Ip
ServerGroupName: Test
VpcId:
Ref: VpcId
HealthCheckConfig:
HttpCheckMethod: Get
HealthCheckEnabled: true
HealthCheckConnectTimeout: Null
Protocol: TCP
Outputs: {}
JSON
format
{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": "",
"Parameters": {
"VpcId": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
}
},
"Resources": {
"NlbServerGroup": {
"Type": "ALIYUN::NLB::ServerGroup",
"Properties": {
"Servers": [
{
"ServerId": "10.1.1.102",
"ServerIp": "10.1.1.102",
"Port": 80,
"Weight": 100,
"ServerType": "Ip"
}
],
"ServerGroupType": "Ip",
"ServerGroupName": "Test",
"VpcId": {
"Ref": "VpcId"
},
"HealthCheckConfig": {
"HttpCheckMethod": "Get",
"HealthCheckEnabled": true,
"HealthCheckConnectTimeout": null
},
"Protocol": "TCP"
}
}
},
"Outputs": {
}
}