ALIYUN::ALB::HealthCheckTemplate类型用于创建健康检查模板。
语法
{
"Type": "ALIYUN::ALB::HealthCheckTemplate",
"Properties": {
"HealthCheckInterval": Integer,
"HealthCheckConnectPort": Integer,
"HealthCheckCodes": List,
"UnhealthyThreshold": Integer,
"HealthCheckMethod": String,
"HealthCheckPath": String,
"HealthCheckTemplateName": String,
"HealthCheckHost": String,
"HealthyThreshold": Integer,
"HealthCheckProtocol": String,
"HealthCheckTimeout": Integer,
"HealthCheckHttpVersion": String,
"ResourceGroupId": String
}
}
属性
|
属性名称 |
类型 |
必须 |
允许更新 |
描述 |
约束 |
|
HealthCheckTemplateName |
String |
是 |
是 |
健康检查模板名称。 |
长度为2~128个英文或中文字符,必须以大小字母或中文开头,可包含数字、半角句号(.)、下划线(_)和短划线(-)。 |
|
HealthCheckCodes |
List |
否 |
是 |
健康检查正常的HTTP状态码。 |
取值:
说明
当HealthCheckProtocol取值为HTTP或gRPC时,该参数才生效。 |
|
HealthCheckConnectPort |
Integer |
否 |
是 |
健康检查使用的端口。 |
取值范围:0~65535。默认值:0,表示使用后端服务器的端口进行健康检查。 |
|
HealthCheckHost |
String |
否 |
是 |
用于健康检查的域名。 |
默认值:$SERVER_IP。 长度限制为1~80个字符。需满足以下要求:
说明
当HealthCheckProtocol取值为HTTP时,该参数才生效。 |
|
HealthCheckHttpVersion |
String |
否 |
否 |
健康检查 HTTP 协议版本。 |
取值:
|
|
HealthCheckInterval |
Integer |
否 |
是 |
健康检查的时间间隔。 |
取值范围:1~50。 默认值:2。 单位:秒。 |
|
HealthCheckMethod |
String |
否 |
是 |
健康检查方法。 |
取值:
说明
当HealthCheckProtocol取值为HTTP或gRPC时,该参数才生效。 |
|
HealthCheckPath |
String |
否 |
是 |
用于健康检查的URL。 |
长度限制为1~80,支持使用字母、数字和短划线(-)、正斜线(/)、半角句号(.)、百分号(%)、半角问号(?)、井号(#)和and(&)以及扩展字符集_;~!()*[]@$^:',+。URL必须以正斜线(/)开头。 说明
当HealthCheckProtocol取值为HTTP时,该参数才生效。 |
|
HealthCheckProtocol |
String |
否 |
是 |
健康检查采用的协议。 |
取值:
|
|
HealthCheckTimeout |
Integer |
否 |
是 |
接收来自运行状况检查响应需要等待的时间。 |
如果后端服务器在指定的时间内没有正确响应,则判定为健康检查失败。 取值范围:1~300。 默认值:5。 单位:秒。 说明
如果HealthCHeckTimeout的值小于HealthCheckInterval的值,则HealthCHeckTimeout无效,超时时间为HealthCheckInterval的值。 |
|
HealthyThreshold |
Integer |
否 |
是 |
健康检查连续成功多少次后,将后端服务器的健康检查状态由失败判定为成功。 |
取值范围:2~10。 默认值:3。 |
|
ResourceGroupId |
String |
否 |
否 |
资源组ID。 |
无 |
|
UnhealthyThreshold |
Integer |
否 |
是 |
健康检查连续失败多少次后,将后端服务器的健康检查状态由成功判定为失败。 |
取值范围:2~10。 默认值:3。 |
返回值
Fn::GetAtt
HealthCheckTemplateId:健康检查模板ID。
示例
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
HealthCheckTemplateName:
Type: String
Description: |-
The name of the health check template.
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.
Resources:
HealthCheckTemplate:
Type: ALIYUN::ALB::HealthCheckTemplate
Properties:
HealthCheckTemplateName:
Ref: HealthCheckTemplateName
Outputs:
HealthCheckTemplateId:
Description: The ID of the health check template.
Value:
Fn::GetAtt:
- HealthCheckTemplate
- HealthCheckTemplateId{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"HealthCheckTemplateName": {
"Type": "String",
"Description": "The name of the health check template.\nThe name must be 2 to 128 characters in length, and can contain letters, digits, periods\n(.), underscores (_), and hyphens (-). The name must start with a letter."
}
},
"Resources": {
"HealthCheckTemplate": {
"Type": "ALIYUN::ALB::HealthCheckTemplate",
"Properties": {
"HealthCheckTemplateName": {
"Ref": "HealthCheckTemplateName"
}
}
}
},
"Outputs": {
"HealthCheckTemplateId": {
"Description": "The ID of the health check template.",
"Value": {
"Fn::GetAtt": [
"HealthCheckTemplate",
"HealthCheckTemplateId"
]
}
}
}
}