Class HealthCheck.Builder

java.lang.Object
software.amazon.awscdk.services.ecs.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

    • command

      @Stability(Stable) public HealthCheck.Builder command(List<String> command)
      Sets the value of HealthCheck.getCommand()
      Parameters:
      command - A string array representing the command that the container runs to determine if it is healthy. This parameter is required. 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" ]

      Returns:
      this
    • interval

      @Stability(Stable) public HealthCheck.Builder interval(Duration interval)
      Sets the value of HealthCheck.getInterval()
      Parameters:
      interval - The time period in seconds between each health check execution. You may specify between 5 and 300 seconds.
      Returns:
      this
    • retries

      @Stability(Stable) public HealthCheck.Builder retries(Number retries)
      Sets the value of HealthCheck.getRetries()
      Parameters:
      retries - The number of times to retry a failed health check before the container is considered unhealthy. You may specify between 1 and 10 retries.
      Returns:
      this
    • startPeriod

      @Stability(Stable) public HealthCheck.Builder startPeriod(Duration startPeriod)
      Parameters:
      startPeriod - 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.
      Returns:
      this
    • timeout

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