Class HealthCheck.Builder
java.lang.Object
software.amazon.awscdk.services.elasticloadbalancingv2.HealthCheck.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<HealthCheck>
- Enclosing interface:
HealthCheck
@Stability(Stable)
public static final class HealthCheck.Builder
extends Object
implements software.amazon.jsii.Builder<HealthCheck>
A builder for
HealthCheck
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofHealthCheck.getEnabled()
healthyGrpcCodes
(String healthyGrpcCodes) Sets the value ofHealthCheck.getHealthyGrpcCodes()
healthyHttpCodes
(String healthyHttpCodes) Sets the value ofHealthCheck.getHealthyHttpCodes()
healthyThresholdCount
(Number healthyThresholdCount) Sets the value ofHealthCheck.getHealthyThresholdCount()
Sets the value ofHealthCheck.getInterval()
Sets the value ofHealthCheck.getPath()
Sets the value ofHealthCheck.getPort()
Sets the value ofHealthCheck.getProtocol()
Sets the value ofHealthCheck.getTimeout()
unhealthyThresholdCount
(Number unhealthyThresholdCount) Sets the value ofHealthCheck.getUnhealthyThresholdCount()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
enabled
Sets the value ofHealthCheck.getEnabled()
- Parameters:
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.- Returns:
this
-
healthyGrpcCodes
Sets the value ofHealthCheck.getHealthyGrpcCodes()
- Parameters:
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").- Returns:
this
-
healthyHttpCodes
Sets the value ofHealthCheck.getHealthyHttpCodes()
- Parameters:
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").- Returns:
this
-
healthyThresholdCount
Sets the value ofHealthCheck.getHealthyThresholdCount()
- Parameters:
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.- Returns:
this
-
interval
Sets the value ofHealthCheck.getInterval()
- Parameters:
interval
- The approximate number of seconds between health checks for an individual target.- Returns:
this
-
path
Sets the value ofHealthCheck.getPath()
- Parameters:
path
- The ping path destination where Elastic Load Balancing sends health check requests.- Returns:
this
-
port
Sets the value ofHealthCheck.getPort()
- Parameters:
port
- The port that the load balancer uses when performing health checks on the targets.- Returns:
this
-
protocol
Sets the value ofHealthCheck.getProtocol()
- Parameters:
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.- Returns:
this
-
timeout
Sets the value ofHealthCheck.getTimeout()
- Parameters:
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.- Returns:
this
-
unhealthyThresholdCount
@Stability(Stable) public HealthCheck.Builder unhealthyThresholdCount(Number unhealthyThresholdCount) Sets the value ofHealthCheck.getUnhealthyThresholdCount()
- Parameters:
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.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<HealthCheck>
- Returns:
- a new instance of
HealthCheck
- Throws:
NullPointerException
- if any required attribute was not provided
-