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 Details

    • Builder

      public Builder()
  • Method Details

    • enabled

      @Stability(Stable) public HealthCheck.Builder enabled(Boolean enabled)
      Sets the value of HealthCheck.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

      @Stability(Stable) public HealthCheck.Builder healthyGrpcCodes(String healthyGrpcCodes)
      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

      @Stability(Stable) public HealthCheck.Builder healthyHttpCodes(String healthyHttpCodes)
      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

      @Stability(Stable) public HealthCheck.Builder healthyThresholdCount(Number healthyThresholdCount)
      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

      @Stability(Stable) public HealthCheck.Builder interval(Duration interval)
      Sets the value of HealthCheck.getInterval()
      Parameters:
      interval - The approximate number of seconds between health checks for an individual target.
      Returns:
      this
    • path

      @Stability(Stable) public HealthCheck.Builder path(String path)
      Sets the value of HealthCheck.getPath()
      Parameters:
      path - The ping path destination where Elastic Load Balancing sends health check requests.
      Returns:
      this
    • port

      @Stability(Stable) public HealthCheck.Builder port(String port)
      Sets the value of HealthCheck.getPort()
      Parameters:
      port - The port that the load balancer uses when performing health checks on the targets.
      Returns:
      this
    • protocol

      @Stability(Stable) public HealthCheck.Builder protocol(Protocol protocol)
      Sets the value of HealthCheck.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

      @Stability(Stable) public HealthCheck.Builder timeout(Duration timeout)
      Sets the value of HealthCheck.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)
      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

      @Stability(Stable) public HealthCheck build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<HealthCheck>
      Returns:
      a new instance of HealthCheck
      Throws:
      NullPointerException - if any required attribute was not provided