ALIYUN::ALB::HealthCheckTemplate is used to create a health check template.

Syntax

{
  "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
  }
}

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 you want to use for health checks. Valid values: 0 to 65535. Default value: 0. This value indictaes that the port of a backend server is used for health checks.
HealthCheckCodes List No Yes The HTTP status codes for a successful health check. Valid values:
  • Valid values if you set the HealthCheckProtocol property to HTTP: http_2xx, http_3xx, http_4xx, and http_5xx. Default value: http_2xx. Separate multiple HTTP status codes with commas (,).
  • Valid values if you set the HealthCheckProtocol property to gRPC: 0 to 99. Default value: 0. Value ranges are supported. You can specify up to 20 value ranges and must separate each range with a comma (,).
Note This property only takes effect when you set the HealthCheckProtocol property to HTTP or gRPC.
UnhealthyThreshold Integer No Yes 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: 3.

HealthCheckMethod String No Yes The method that you want to use for health checks. Default value: HEAD. Valid values:
  • HEAD: By default, HTTP health checks use the HEAD method.
  • POST: By default, gRPC health checks use the POST method.
  • GET: If the length of a response packet exceeds 8 KB, the response is truncated. This does not affect the health check result.
Note This property only takes effect when you set the HealthCheckProtocol property to HTTP or gRPC.
HealthCheckPath String No Yes The URL path that you want to use for health checks. The URL path must be 1 to 80 characters in length, and can contain letters, digits, the - / . % ? # & special characters, and the _ ; ~ ! ( ) * [ ] @ $ ^ : ' , + extended characters. The URL path must start with a forward slash (/).
Note This property only takes effect when you set the HealthCheckProtocol property to HTTP.
HealthCheckTemplateName String Yes Yes 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.
HealthCheckHost String No Yes The domain name that you want to use for health checks.

Default value: $SERVER_IP.

The domain name must be 1 to 80 characters in length. The domain name must meet the following requirements:
  • The domain name can contain lowercase letters, digits, hyphens (-), and periods (.).
  • The domain name must contain at least one period (.) but cannot start or end with a period (.).
  • The rightmost domain label can contain only letters but cannot contain digits or hyphens (-).
  • Other domain labels cannot start or end with a hyphen (-).
Note This property only takes effect when you set the HealthCheckProtocol property to HTTP.
HealthyThreshold Integer No Yes 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: 3.

HealthCheckProtocol String No Yes The protocol that you want to use for health checks. Default value: HTTP. Valid values:
  • HTTP: The system sends HEAD or GET requests to a backend server to simulate access from a browser and check whether the backend server is healthy.
  • TCP: The system sends SYN packets to a backend server to check whether the port of the backend server is available to receive requests.
  • gRPC: The system sends POST or GET requests to a backend server to check whether the backend server is healthy.
HealthCheckTimeout Integer No Yes The timeout period of a health check response. If a backend server 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.

Return values

Fn::GetAtt

HealthCheckTemplateId: the ID of the health check template.

Examples

  • JSON format

    {
      "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"
            ]
          }
        }
      }
    }
  • YAML format

    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