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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofHealthCheck.getCommand()
Sets the value ofHealthCheck.getInterval()
Sets the value ofHealthCheck.getRetries()
startPeriod
(Duration startPeriod) Sets the value ofHealthCheck.getStartPeriod()
Sets the value ofHealthCheck.getTimeout()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
command
Sets the value ofHealthCheck.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
Sets the value ofHealthCheck.getInterval()
- Parameters:
interval
- The time period in seconds between each health check execution. You may specify between 5 and 300 seconds.- Returns:
this
-
retries
Sets the value ofHealthCheck.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
Sets the value ofHealthCheck.getStartPeriod()
- 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
Sets the value ofHealthCheck.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
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<HealthCheck>
- Returns:
- a new instance of
HealthCheck
- Throws:
NullPointerException
- if any required attribute was not provided
-