Modifies a health check template.

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 UpdateHealthCheckTemplateAttribute

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

ClientToken String No 5A2CFF0E-5718-45B5-9D4D-70B3FF3898

The client token that is used to ensure the idempotency of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

HealthCheckTemplateName String No 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.

HealthCheckConnectPort Integer No 80

The number of the port that is used for health checks.

Valid values: 0 to 65535.

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

HealthCheckHost String No $_ip

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

  • $SERVER_IP (default value): The private IP addresses of backend servers. If the $_ip parameter is set or the HealthCheckHost parameter is not set, ALB uses the private IP addresses of backend servers as the domain names for health checks.
  • domain: The domain name must be 1 to 80 characters in length, and can contain only letters, digits, periods (.), and hyphens (-).
Note This parameter is valid only if the HealthCheckProtocol parameter is set to HTTP.
HealthCheckCodes Array of String No http_2xx,http_3xx

The HTTP status code indicating that the health check is successful.

Default value: http_2xx. The HTTP status code that indicates a successful health check. Separate multiple HTTP status codes with commas (,).

Valid values: http_2xx, http_3xx, http_4xx, and http_5xx.

Note This parameter is valid only if the HealthCheckProtocol parameter is set to HTTP.
HealthCheckInterval Integer No 5

The interval between two consecutive health checks.

Valid values: 1 to 50. Unit: seconds.

Default value: 2.

HealthCheckTimeout Integer No 3

The time period to wait for a health check response. If the backend server does not respond within the specified timeout period, the backend server is unhealthy.

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 value of the HealthCheckTimeout parameter is ignored and the value of the HealthCheckInterval parameter is regarded as the timeout period.
HealthCheckPath String No /test/index.html

The URL that is used for health checks.

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

Note The URL must start with a forward slash (/). This parameter is valid only if the HealthCheckProtocol parameter is set to HTTP.
HealthCheckMethod String No HEAD

The health check method.

Valid values: GET and HEAD.

Default value: HEAD.

Note This parameter is required only if the HealthCheckProtocol parameter is set to HTTP.
HealthCheckProtocol String No HTTP

The protocol that is used for health checks.

Valid values: HTTP and TCP.

Default value: HTTP.

HealthCheckHttpVersion String No HTTP1.0

The version of the HTTP protocol.

Valid values: HTTP1.0 and HTTP1.1.

Default value: HTTP1.1.

Note This parameter is required only if the HealthCheckProtocol parameter is set to HTTP.
HealthyThreshold Integer No 4

The number of health checks that an unhealthy backend server must consecutively pass before it is declared healthy (from fail to success).

Valid values: 2 to 10.

Default value: 3.

UnhealthyThreshold Integer No 4

The number of health checks that a healthy backend server must consecutively fail before it is declared unhealthy (from success to fail).

Valid values: 2 to 10.

Default value: 3.

DryRun Boolean No true

Specifies whether to precheck this request. Valid values:

  • true: prechecks the API request. Resources are not created. The system checks the required parameters, request format, and service limits. If the request fails the check, the corresponding error message is returned. If the request passes the precheck, the DryRunOperation error code is returned.
  • false (default): checks the request. After the request passes the check, an HTTP_2xx status code is returned and the operation is performed.
HealthCheckTemplateId String No hct-bp1qjwo61pqz3ahltv0mw

The ID of the health check template.

Response parameters

Parameter Type Example Description
RequestId String 365F4154-92F6-4AE4-92F8-7FF34B540710

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=UpdateHealthCheckTemplateAttribute
&ClientToken=5A2CFF0E-5718-45B5-9D4D-70B3FF3898
&HealthCheckTemplateName=HealthCheckTemplate1
&HealthCheckConnectPort=80
&HealthCheckHost=$_ip
&HealthCheckCodes=["http_2xx,http_3xx"]
&HealthCheckInterval=5
&HealthCheckTimeout=3
&HealthCheckPath=/test/index.html
&HealthCheckMethod=HEAD
&HealthCheckProtocol=HTTP
&HealthCheckHttpVersion=HTTP1.0
&HealthyThreshold=4
&UnhealthyThreshold=4
&DryRun=true
&HealthCheckTemplateId=hct-bp1qjwo61pqz3ahltv0mw
&Common request parameters

Sample success responses

XML format

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

<UpdateHealthCheckTemplateAttributeResponse>
    <RequestId>365F4154-92F6-4AE4-92F8-7FF34B540710</RequestId>
</UpdateHealthCheckTemplateAttributeResponse>

JSON format

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

{
  "RequestId" : "365F4154-92F6-4AE4-92F8-7FF34B540710"
}

Error codes

HttpCode Error code Error message Description
400 IncorrectStatus.HealthCheckTemplate The status of %s [%s] is incorrect. The error message returned because the status of the specified resource %s [%s] is invalid.
404 ResourceNotFound.HealthCheckTemplate The specified resource %s is not found. The error message returned because the specified resource %s does not exist.

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