Queries the attributes of health check templates.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ListHealthCheckTemplates

The operation that you want to perform. Set the value to ListHealthCheckTemplates.

NextToken String No FFmyTO70tTpLG6I3FmYAXGKPd****

The token that is used for the next query. Valid values:

  • If this is your first query or no subsequent query is to be sent, ignore this parameter.
  • If a subsequent query is to be sent, set the value to the value of NextToken that was returned from the last call.
MaxResults Integer No 50

The number of entries to return on each page. Valid values: 1 to 100. Default value: 20.

HealthCheckTemplateIds.N String No hct-bp1qjwo61pqz3ahltv****

The IDs of health check templates. You can specify up to 20 IDs in each call. The results are filtered based on the specified IDs.

HealthCheckTemplateNames.N String No test

The names of health check templates. You can specify up to 10 names in each call. The results are filtered based on the specified names.

Response parameters

Parameter Type Example Description
HealthCheckTemplates Array of HealthCheckTemplate

The health check templates.

HealthCheckConnectPort Integer 80

The port that is used for health checks.

Valid values: 0 to 65535.

Default value: 0. This value indicates that the port on a backend server is used for health checks.

HealthCheckHost String $_ip

The domain name that is used for health checks. Valid values:

$SERVER_IP (default): the private IP addresses of backend servers. If you do not set the HealthCheckHost parameter or set the parameter to $SERVER_IP, the Application Load Balancer (ALB) uses the private IP addresses of backend servers for health checks.

domain: The domain name must be 1 to 80 characters in length and can contain letters, digits, periods (.), and hyphens (-).

Note This parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP.
HealthCheckCodes Array of String http_2xx,http_3xx

The HTTP status codes that are used to determine whether the backend server passes the health check.

  • If HealthCheckProtocol is set to HTTP, HealthCheckCodes can be set to http_2xx (default), http_3xx, http_4xx, and http_5xx. Separate multiple HTTP status codes with a comma (,).
  • If HealthCheckProtocol is set to gRPC, HealthCheckCodes can be set to 0 to 99. Default value: 0. Value ranges are supported. You can enter 20 value ranges at most and must separate each range with a comma (,).
Note This parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP or gRPC.
HealthCheckHttpVersion String HTTP 1.0

The HTTP version that is used for health checks.

Valid values: HTTP 1.0 and HTTP 1.1.

Default value: HTTP 1.1.

Note This parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP.
HealthCheckInterval Integer 5

The interval between two consecutive health checks. Unit: seconds. Valid values: 1 to 50. Default value: 2.

HealthCheckMethod String HEAD

The HTTP method that is used for health checks. Valid values:

  • HEAD: By default, HTTP health checks use the HEAD method.
  • GET: If the size of a response exceeds 8 KB, the response is truncated. However, the health check result is not affected.
  • POST: By default, gRPC health checks use the POST method.
Note This parameter takes effect only when the HealthCheckProtocol parameter is set to HTTP or gRPC.
HealthCheckPath String /test/index.html

The URL that is used for health checks.

The URL must be 1 to 80 characters in length and can contain only letters, digits, hyphens (-), forward slashes (/), periods (.), percent signs (%), question marks (?), number signs (#), and ampersands (&). The URL can also contain the following extended characters: _ ; ~ ! ( ) * [ ] @ $ ^ : ' , +. The URL path must start with a forward slash (/).

HealthCheckProtocol String HTTP

The protocol that is used for health checks. Valid values:

  • HTTP (default): To perform HTTP health checks, ALB sends HEAD or GET requests to a backend server to check whether the backend server is healthy.
  • TCP: To perform TCP health checks, ALB sends SYN packets to a backend server to check whether the port of the backend server is available to receive requests.
  • gRPC: To perform gRPC health checks, ALB sends POST or GET requests to a backend server to check whether the backend server is healthy.
HealthCheckTemplateId String hct-bp1qjwo61pqz3ahltv****

The ID of the health check template.

HealthCheckTemplateName String HealthCheckTemplate1

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.

HealthCheckTimeout Integer 3

The timeout period of a health check. 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. Unit: seconds.

Default value: 5.

Note If the value of the HealthCheckTimeout parameter is smaller than that of the HealthCheckInterval parameter, the timeout period specified by the HealthCheckTimeout parameter is ignored and the value of the HealthCheckInterval parameter is used as the timeout period.
HealthyThreshold Integer 4

The number of times that an unhealthy backend server must consecutively pass health checks before it is declared healthy. In this case, the health status is changed from fail to success.

Valid values: 2 to 10.

Default value: 3.

UnhealthyThreshold Integer 4

The number of times that a healthy backend server must consecutively fail health checks before it is declared unhealthy. In this case, the health status is changed from success to fail.

Valid values: 2 to 10.

Default value: 3.

MaxResults Integer 50

The number of entries returned per page. Valid values: 1 to 100. Default value: 20.

NextToken String FFmyTO70tTpLG6I3FmYAXGKPd****

The token that is used for the next query. Valid values:

  • If NextToken is empty, it indicates that no subsequent query is to be sent.
  • If a value of NextToken is returned, the value is the token that is used for the subsequent query.
RequestId String 365F4154-92F6-4AE4-92F8-7FF34B540710

The ID of the request.

TotalCount Integer 1000

The number of entries returned.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListHealthCheckTemplates
&NextToken=FFmyTO70tTpLG6I3FmYAXGKPd****
&MaxResults=50
&HealthCheckTemplateIds=["hct-bp1qjwo61pqz3ahltv****"]
&HealthCheckTemplateNames=["test"]
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListHealthCheckTemplatesResponse>
    <HealthCheckTemplates>
        <HealthCheckConnectPort>80</HealthCheckConnectPort>
        <HealthCheckHost>$_ip</HealthCheckHost>
        <HealthCheckCodes>http_2xx,http_3xx</HealthCheckCodes>
        <HealthCheckHttpVersion>HTTP 1.0</HealthCheckHttpVersion>
        <HealthCheckInterval>5</HealthCheckInterval>
        <HealthCheckMethod>HEAD</HealthCheckMethod>
        <HealthCheckPath>/test/index.html</HealthCheckPath>
        <HealthCheckProtocol>HTTP</HealthCheckProtocol>
        <HealthCheckTemplateId>hct-bp1qjwo61pqz3ahltv****</HealthCheckTemplateId>
        <HealthCheckTemplateName>HealthCheckTemplate1</HealthCheckTemplateName>
        <HealthCheckTimeout>3</HealthCheckTimeout>
        <HealthyThreshold>4</HealthyThreshold>
        <UnhealthyThreshold>4</UnhealthyThreshold>
    </HealthCheckTemplates>
    <MaxResults>50</MaxResults>
    <NextToken>FFmyTO70tTpLG6I3FmYAXGKPd****</NextToken>
    <RequestId>365F4154-92F6-4AE4-92F8-7FF34B540710</RequestId>
    <TotalCount>1000</TotalCount>
</ListHealthCheckTemplatesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "HealthCheckTemplates" : [ {
    "HealthCheckConnectPort" : 80,
    "HealthCheckHost" : "$_ip",
    "HealthCheckCodes" : [ "http_2xx,http_3xx" ],
    "HealthCheckHttpVersion" : "HTTP 1.0",
    "HealthCheckInterval" : 5,
    "HealthCheckMethod" : "HEAD",
    "HealthCheckPath" : "/test/index.html",
    "HealthCheckProtocol" : "HTTP",
    "HealthCheckTemplateId" : "hct-bp1qjwo61pqz3ahltv****",
    "HealthCheckTemplateName" : "HealthCheckTemplate1",
    "HealthCheckTimeout" : 3,
    "HealthyThreshold" : 4,
    "UnhealthyThreshold" : 4
  } ],
  "MaxResults" : 50,
  "NextToken" : "FFmyTO70tTpLG6I3FmYAXGKPd****",
  "RequestId" : "365F4154-92F6-4AE4-92F8-7FF34B540710",
  "TotalCount" : 1000
}

Error codes

For a list of error codes, visit the API Error Center.