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:17.047Z") @Stability(Stable) public interface HealthCheck extends software.amazon.jsii.JsiiSerializable
Properties for configuring a health check.

Example:

 Cluster cluster;
 ApplicationLoadBalancedFargateService loadBalancedFargateService = ApplicationLoadBalancedFargateService.Builder.create(this, "Service")
         .cluster(cluster)
         .memoryLimitMiB(1024)
         .cpu(512)
         .taskImageOptions(ApplicationLoadBalancedTaskImageOptions.builder()
                 .image(ContainerImage.fromRegistry("amazon/amazon-ecs-sample"))
                 .command(List.of("command"))
                 .entryPoint(List.of("entry", "point"))
                 .build())
         .build();
 loadBalancedFargateService.targetGroup.configureHealthCheck(HealthCheck.builder()
         .path("/custom-health-path")
         .build());
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    A builder for HealthCheck
    static final class 
    An implementation for HealthCheck
  • Method Summary

    Modifier and Type
    Method
    Description
     
    default Boolean
    Indicates whether health checks are enabled.
    default String
    GRPC code to use when checking for a successful response from a target.
    default String
    HTTP code to use when checking for a successful response from a target.
    default Number
    The number of consecutive health checks successes required before considering an unhealthy target healthy.
    default Duration
    The approximate number of seconds between health checks for an individual target.
    default String
    The ping path destination where Elastic Load Balancing sends health check requests.
    default String
    The port that the load balancer uses when performing health checks on the targets.
    default Protocol
    The protocol the load balancer uses when performing health checks on targets.
    default Duration
    The amount of time, in seconds, during which no response from a target means a failed health check.
    default Number
    The number of consecutive health check failures required before considering a target unhealthy.

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Method Details

    • getEnabled

      @Stability(Stable) @Nullable default Boolean getEnabled()
      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.

      Default: - Determined automatically.

    • getHealthyGrpcCodes

      @Stability(Stable) @Nullable default String getHealthyGrpcCodes()
      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").

      Default: - 12

    • getHealthyHttpCodes

      @Stability(Stable) @Nullable default String getHealthyHttpCodes()
      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").

    • getHealthyThresholdCount

      @Stability(Stable) @Nullable default Number getHealthyThresholdCount()
      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.

      Default: 5 for ALBs, 3 for NLBs

    • getInterval

      @Stability(Stable) @Nullable default Duration getInterval()
      The approximate number of seconds between health checks for an individual target.

      Must be 5 to 300 seconds

      Default: 10 seconds if protocol is `GENEVE`, 35 seconds if target type is `lambda`, else 30 seconds

    • getPath

      @Stability(Stable) @Nullable default String getPath()
      The ping path destination where Elastic Load Balancing sends health check requests.

      Default: /

    • getPort

      @Stability(Stable) @Nullable default String getPort()
      The port that the load balancer uses when performing health checks on the targets.

      Default: 'traffic-port'

    • getProtocol

      @Stability(Stable) @Nullable default Protocol getProtocol()
      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.

      Default: HTTP for ALBs, TCP for NLBs

    • getTimeout

      @Stability(Stable) @Nullable default Duration getTimeout()
      The amount of time, in seconds, during which no response from a target means a failed health check.

      Must be 2 to 120 seconds.

      Default: 6 seconds if the protocol is HTTP, 5 seconds if protocol is `GENEVE`, 30 seconds if target type is `lambda`, 10 seconds for TCP, TLS, or HTTPS

    • getUnhealthyThresholdCount

      @Stability(Stable) @Nullable default Number getUnhealthyThresholdCount()
      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.

      Default: 2

    • builder

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