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
}
}
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. | Default value: Wrr. Valid values:
|
AddressIPVersion | String | No | No | The protocol version. | Default value: ipv4. Valid values:
|
Servers | List | No | No | The list of servers. | For more information, see Servers properties. |
PreserveClientIpEnabled | Boolean | No | No | Specifies whether to enable client IP preservation. | Default value: false. Valid values:
|
ServerGroupType | String | No | No | The type of the server group. | Default value: Instance. Valid values:
|
PersistenceEnabled | Boolean | No | No | Specifies whether to enable session persistence. | Valid values:
|
ConnectionDrainEnabled | Boolean | No | No | Specifies whether to enable connection draining. | Default value: false. 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 the ServerGroupType property to Instance, servers can be added to the
specified server group only if the servers and the server group are in the same VPC.
|
HealthCheckConfig | Map | Yes | No | The configurations of the health check feature. | For more information, see HealthCheckConfig properties. |
Protocol | String | No | No | The backend protocol. | Default value: TCP. 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 (-). The name must start with a letter. |
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. | Default value: ecs. Valid values:
|
Description | String | No | No | The description of the backend server. | None. |
ServerId | String | Yes | No | The ID of the instance that is used as the backend server. | Valid values:
Note The ServerType property is required if you set the ServerId property to the ID of
the ENI instance or the elastic container instance.
|
ServerIp | String | No | No | The IP address of the ECS instance, ENI instance, or elastic container instance. | None. |
Port | Integer | Yes | No | The backend port that is used 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 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. The path must start with a forward slash (/).
Note This property takes effect when you set the HealthCheckType property to HTTP.
|
HealthCheckConnectPort | Integer | No | No | The port that you want to use for health checks on backend servers. | Valid values: 0 to 65535.
Default value: 0. This value 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. When this number is reached, the health check status is changed from successful to failed. | Valid values: 2 to 10.
Default value: 2. |
HttpCheckMethod | String | Yes | No | The method that you want to use for health checks. | Default value: GET. Valid values:
Note This property takes effect when you set the HealthCheckType property 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. When this number is reached, the health check status is changed from failed to successful. | 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 you set the HealthCheckType property to HTTP.
|
HealthCheckEnabled | Boolean | No | No | Specifies whether to enable the health check feature. | Default value: true. Valid values:
|
HealthCheckHttpCode | List | No | No | The HTTP status codes that the system returns for health checks. |
Separate multiple HTTP status codes with commas (,). Default value: http_2xx. Valid values:
Note This property takes effect when you set the HealthCheckType property to HTTP.
|
HealthCheckType | String | No | No | The protocol that you want to use for health checks. | Default value: TCP. Valid values:
|
Return values
Fn::GetAtt
ServerGroupId: the ID of the server group.
Examples
JSON
format
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"VpcId": {
"Type": "String",
"Description": "ID of VPC"
},
"HealthCheckConfig": {
"Type": "Json",
"Description": "Health Check Config"
},
"ServerGroupName": {
"Type": "String",
"Description": "Name of ServerGroup"
}
},
"Resources": {
"ExtensionResource": {
"Type": "ALIYUN::NLB::ServerGroup",
"Properties": {
"VpcId": {
"Ref": "VpcId"
},
"HealthCheckConfig": {
"Ref": "HealthCheckConfig"
},
"ServerGroupName": {
"Ref": "ServerGroupName"
}
}
}
},
"Outputs": {
"ServerGroupId": {
"Description": "ID of ServerGroup",
"Value": {
"Fn::GetAtt": [
"ExtensionResource",
"ServerGroupId"
]
}
}
}
}