All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
HealthCheck.Jsii$Proxy

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:16.932Z") @Stability(Stable) public interface HealthCheck extends software.amazon.jsii.JsiiSerializable
Describe the health check to a load balancer.

Example:

 IVpc vpc;
 AutoScalingGroup myAutoScalingGroup;
 LoadBalancer lb = LoadBalancer.Builder.create(this, "LB")
         .vpc(vpc)
         .internetFacing(true)
         .healthCheck(HealthCheck.builder()
                 .port(80)
                 .build())
         .build();
 lb.addTarget(myAutoScalingGroup);
 lb.addListener(LoadBalancerListener.builder()
         .externalPort(80)
         .build());
 
  • Method Details

    • getPort

      @Stability(Stable) @NotNull Number getPort()
      What port number to health check on.
    • getHealthyThreshold

      @Stability(Stable) @Nullable default Number getHealthyThreshold()
      After how many successful checks is an instance considered healthy.

      Default: 2

    • getInterval

      @Stability(Stable) @Nullable default Duration getInterval()
      Number of seconds between health checks.

      Default: Duration.seconds(30)

    • getPath

      @Stability(Stable) @Nullable default String getPath()
      What path to use for HTTP or HTTPS health check (must return 200).

      For SSL and TCP health checks, accepting connections is enough to be considered healthy.

      Default: "/"

    • getProtocol

      @Stability(Stable) @Nullable default LoadBalancingProtocol getProtocol()
      What protocol to use for health checking.

      The protocol is automatically determined from the port if it's not supplied.

      Default: Automatic

    • getTimeout

      @Stability(Stable) @Nullable default Duration getTimeout()
      Health check timeout.

      Default: Duration.seconds(5)

    • getUnhealthyThreshold

      @Stability(Stable) @Nullable default Number getUnhealthyThreshold()
      After how many unsuccessful checks is an instance considered unhealthy.

      Default: 5

    • builder

      @Stability(Stable) static HealthCheck.Builder builder()
      Returns:
      a HealthCheck.Builder of HealthCheck