public static final class HealthCheck.Builder
extends java.lang.Object
HealthCheck
Constructor and Description |
---|
Builder() |
public HealthCheck.Builder enabled(java.lang.Boolean enabled)
HealthCheck.getEnabled()
enabled
- Indicates whether health checks are enabled.
If the target type is lambda,
health checks are disabled by default but can be enabled. If the target type
is instance or ip, health checks are always enabled and cannot be disabled.this
public HealthCheck.Builder healthyGrpcCodes(java.lang.String healthyGrpcCodes)
HealthCheck.getHealthyGrpcCodes()
healthyGrpcCodes
- GRPC code to use when checking for a successful response from a target.
You can specify values between 0 and 99. You can specify multiple values
(for example, "0,1") or a range of values (for example, "0-5").this
public HealthCheck.Builder healthyHttpCodes(java.lang.String healthyHttpCodes)
HealthCheck.getHealthyHttpCodes()
healthyHttpCodes
- HTTP code to use when checking for a successful response from a target.
For Application Load Balancers, you can specify values between 200 and
499, and the default value is 200. You can specify multiple values (for
example, "200,202") or a range of values (for example, "200-299").this
public HealthCheck.Builder healthyThresholdCount(java.lang.Number healthyThresholdCount)
HealthCheck.getHealthyThresholdCount()
healthyThresholdCount
- The number of consecutive health checks successes required before considering an unhealthy target healthy.
For Application Load Balancers, the default is 5. For Network Load Balancers, the default is 3.this
public HealthCheck.Builder interval(Duration interval)
HealthCheck.getInterval()
interval
- The approximate number of seconds between health checks for an individual target.this
public HealthCheck.Builder path(java.lang.String path)
HealthCheck.getPath()
path
- The ping path destination where Elastic Load Balancing sends health check requests.this
public HealthCheck.Builder port(java.lang.String port)
HealthCheck.getPort()
port
- The port that the load balancer uses when performing health checks on the targets.this
public HealthCheck.Builder protocol(Protocol protocol)
HealthCheck.getProtocol()
protocol
- The protocol the load balancer uses when performing health checks on targets.
The TCP protocol is supported for health checks only if the protocol of the target group is TCP, TLS, UDP, or TCP_UDP.
The TLS, UDP, and TCP_UDP protocols are not supported for health checks.this
public HealthCheck.Builder timeout(Duration timeout)
HealthCheck.getTimeout()
timeout
- The amount of time, in seconds, during which no response from a target means a failed health check.
For Application Load Balancers, the range is 2-60 seconds and the
default is 5 seconds. For Network Load Balancers, this is 10 seconds for
TCP and HTTPS health checks and 6 seconds for HTTP health checks.this
public HealthCheck.Builder unhealthyThresholdCount(java.lang.Number unhealthyThresholdCount)
HealthCheck.getUnhealthyThresholdCount()
unhealthyThresholdCount
- The number of consecutive health check failures required before considering a target unhealthy.
For Application Load Balancers, the default is 2. For Network Load
Balancers, this value must be the same as the healthy threshold count.this
public HealthCheck build()
HealthCheck
java.lang.NullPointerException
- if any required attribute was not provided