ALIYUN::ALB::ServerGroup is used to create a server group.
Syntax
{
"Type": "ALIYUN::ALB::ServerGroup",
"Properties": {
"VpcId": String,
"ResourceGroupId": String,
"Scheduler": String,
"StickySessionConfig": Map,
"HealthCheckConfig": Map,
"Protocol": String,
"ServerGroupType": String,
"ServerGroupName": String,
"Tags": List,
"ServiceName": String
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
VpcId | String | Yes | No | The ID of the virtual private cloud (VPC). | You can add only servers that are deployed in the VPC to the server group. |
ResourceGroupId | String | No | Yes | The ID of the resource group. | None. |
Scheduler | String | No | Yes | The scheduling algorithm. | Valid values:
|
StickySessionConfig | Map | No | Yes | The configurations of session persistence. | For more information, see StickySessionConfig properties. |
HealthCheckConfig | Map | Yes | Yes | The configurations of health checks. | For more information, see HealthCheckConfig properties. |
Protocol | String | No | No | The backend protocol. | Valid values:
|
ServerGroupType | String | No | No | The type of the server group. | Valid values:
|
ServerGroupName | String | Yes | Yes | 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. |
Tags | List | No | Yes | The tags of the server group. | You can specify up to 20 tags for the server group. For more information, see Tags properties. |
ServiceName | String | No | Yes | The name of the Kubernetes service that is associated with the server group. | Note This property is applicable only to scenarios where Application Load Balancer (ALB) Ingresses are used. |
StickySessionConfig syntax
"StickySessionConfig": {
"Cookie": String,
"CookieTimeout": Integer,
"StickySessionType": String,
"StickySessionEnabled": Boolean
}
StickySessionConfig properties
Property | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
Cookie | String | No | Yes | The cookie that you configure for the server. | The cookie must be 1 to 200 characters in length, and can contain letters and digits. The cookie cannot contain commas (,), semicolons (;), or spaces. The cookie cannot start with a dollar sign ($). Note This property is required if you set the StickySessionEnabled property to true and the StickySessionType property to Server. |
CookieTimeout | Integer | No | Yes | The timeout period of the cookie. | Valid values: 1 to 86400. Default value: 1000. Unit: seconds.Note This property is required if you set the StickySessionEnabled property to true and the StickySessionType property to Insert. |
StickySessionType | String | No | Yes | The method that is used to handle the cookie. | Default value: Insert. Valid values:
Note This property is required if you set the StickySessionEnabled property to true. |
StickySessionEnabled | Boolean | No | Yes | Specifies whether to enable session persistence. | Valid values:
Note This property is required if you set the ServerGroupType property to Instance or Ip . |
HealthCheckConfig syntax
"HealthCheckConfig": {
"HealthCheckInterval": Integer,
"HealthCheckConnectPort": Integer,
"HealthCheckCodes": List,
"UnhealthyThreshold": Integer,
"HealthCheckMethod": String,
"HealthCheckPath": String,
"HealthCheckHost": String,
"HealthyThreshold": Integer,
"HealthCheckProtocol": String,
"HealthCheckHttpVersion": String,
"HealthCheckEnabled": Boolean,
"HealthCheckTimeout": Integer
}
HealthCheckConfig properties
Property | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
HealthCheckInterval | Integer | No | Yes | The interval between consecutive health checks. | Valid values: 1 to 50. Default value: 2. Unit: seconds. |
HealthCheckConnectPort | Integer | No | Yes | The port that is used for health checks on backend servers. | Valid values: 0 to 65535. Default value: 0. This value indicates that the health check port specified on a backend server is used. |
HealthCheckCodes | List | No | Yes | The status codes for health checks. | Valid values:
Note This property takes effect only if the HealthCheckProtocol property is set to HTTP. |
UnhealthyThreshold | Integer | No | Yes | The number of consecutive failed health checks that must occur in a healthy backend server before the backend server is declared unhealthy. If this number is reached, the health check status is changed from successful to failed. | Valid values: 2 to 10. Default value: 3. |
HealthCheckMethod | String | No | Yes | The health check method. | Valid values:
Note This property takes effect only if the HealthCheckProtocol property is set to HTTP. |
HealthCheckPath | String | No | Yes | The path that is used for health checks. | The path must be 1 to 80 characters in length, and can contain letters, digits, and special characters. Special characters include - / . % ? # & = _ ; ~ ! ( ) ∗ [ ] @ $ ^ : ' , + . The path must start with a forward slash (/). Note This property takes effect only if the HealthCheckProtocol property is set to HTTP. |
HealthCheckHost | String | No | Yes | The domain name that is used for health checks. | The domain name must be 1 to 80 characters in length, and can contain lowercase letters, digits, hyphens (-), and periods (.). Example: Note This property takes effect only if the HealthCheckProtocol property is set to HTTP. |
HealthyThreshold | Integer | No | Yes | The number of consecutive successful health checks that must occur in an unhealthy backend server before the backend server is declared healthy. If this number is reached, the health check status is changed from failed to successful. | Valid values: 2 to 10. Default value: 3. |
HealthCheckProtocol | String | No | Yes | The protocol that is used for health checks. | Valid values:
|
HealthCheckHttpVersion | String | No | Yes | The version of HTTP that is used for health checks. | Default value: HTTP1.1. Valid values:
Note This property takes effect only if the HealthCheckProtocol property is set to HTTP. |
HealthCheckEnabled | Boolean | Yes | Yes | Specifies whether to enable health checks. | Valid values:
|
HealthCheckTimeout | Integer | No | Yes | The timeout period of a health check response. | If a backend server, such as an Elastic Compute Service (ECS) instance, does not return a health check response within the specified timeout period, the server fails the health check. Valid values: 1 to 300. Default value: 5. Unit: seconds.Note If the value of the HealthCheckTimeout property is smaller than the value of the HealthCheckInterval property, the timeout period specified by the HealthCheckTimeout property becomes invalid, and the value of the HealthCheckInterval property is used as the timeout period. |
Tags syntax
"Tags": [
{
"Key": String,
"Value": String
}
]
Tags properties
Property | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
Key | String | Yes | No | The key of the tag. | The tag key must be 1 to 128 characters in length, and cannot contain http:// or https://. The tag key cannot start with aliyun or acs: . |
Value | String | No | No | The value of the tag. | The tag value can be up to 128 characters in length, and cannot contain http:// or https://. The tag value cannot start with aliyun or acs: . |
Return values
Fn::GetAtt
ServerGroupId: the ID of the server group.
Example
JSON
format{ "ROSTemplateFormatVersion": "2015-09-01", "Parameters": { "VpcId": { "AssociationProperty": "ALIYUN::ECS::VPC::VPCId", "Type": "String", "Label": { "en": "Existing VPC Instance ID" } } }, "Resources": { "ServerGroup": { "Type": "ALIYUN::ALB::ServerGroup", "Properties": { "VpcId": { "Ref": "VpcId" }, "StickySessionConfig": { "Cookie": "B490B5EBF6F3CD402E515D22****", "CookieTimeout": 1000, "StickySessionEnabled": true, "StickySessionType": "Insert" }, "HealthCheckConfig": { "HealthCheckConnectPort": 80, "HealthCheckEnabled": true, "HealthCheckHost": "www.example.com", "HealthCheckCodes": [ "http_2xx" ], "HealthCheckHttpVersion": "HTTP1.0", "HealthCheckInterval": 5, "HealthCheckMethod": "HEAD", "HealthCheckPath": "/test/index.html", "HealthCheckProtocol": "HTTP", "HealthCheckTimeout": 3, "HealthyThreshold": 4, "UnhealthyThreshold": 4 }, "ServerGroupName": "TestServerGroup" } } }, "Outputs": { "ServerGroupId": { "Description": "The ID of the server group.", "Value": { "Fn::GetAtt": [ "ServerGroup", "ServerGroupId" ] } } } }