Interface HealthCheck

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

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-15T10:24:58.826Z") @Stability(Stable) public interface HealthCheck extends software.amazon.jsii.JsiiSerializable
The health check command and associated configuration parameters for the container.

Example:

 Vpc vpc;
 SecurityGroup securityGroup;
 QueueProcessingFargateService queueProcessingFargateService = QueueProcessingFargateService.Builder.create(this, "Service")
         .vpc(vpc)
         .memoryLimitMiB(512)
         .image(ContainerImage.fromRegistry("test"))
         .healthCheck(HealthCheck.builder()
                 .command(List.of("CMD-SHELL", "curl -f http://localhost/ || exit 1"))
                 // the properties below are optional
                 .interval(Duration.minutes(30))
                 .retries(123)
                 .startPeriod(Duration.minutes(30))
                 .timeout(Duration.minutes(30))
                 .build())
         .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
     
    A string array representing the command that the container runs to determine if it is healthy.
    default Duration
    The time period in seconds between each health check execution.
    default Number
    The number of times to retry a failed health check before the container is considered unhealthy.
    default Duration
    The optional grace period within which to provide containers time to bootstrap before failed health checks count towards the maximum number of retries.
    default Duration
    The time period in seconds to wait for a health check to succeed before it is considered a failure.

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Method Details

    • getCommand

      @Stability(Stable) @NotNull List<String> getCommand()
      A string array representing the command that the container runs to determine if it is healthy.

      The string array must start with CMD to execute the command arguments directly, or CMD-SHELL to run the command with the container's default shell.

      For example: [ "CMD-SHELL", "curl -f http://localhost/ || exit 1" ]

    • getInterval

      @Stability(Stable) @Nullable default Duration getInterval()
      The time period in seconds between each health check execution.

      You may specify between 5 and 300 seconds.

      Default: Duration.seconds(30)

    • getRetries

      @Stability(Stable) @Nullable default Number getRetries()
      The number of times to retry a failed health check before the container is considered unhealthy.

      You may specify between 1 and 10 retries.

      Default: 3

    • getStartPeriod

      @Stability(Stable) @Nullable default Duration getStartPeriod()
      The optional grace period within which to provide containers time to bootstrap before failed health checks count towards the maximum number of retries.

      You may specify between 0 and 300 seconds.

      Default: No start period

    • getTimeout

      @Stability(Stable) @Nullable default Duration getTimeout()
      The time period in seconds to wait for a health check to succeed before it is considered a failure.

      You may specify between 2 and 60 seconds.

      Default: Duration.seconds(5)

    • builder

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