Interface CfnContainerGroupDefinition.ContainerHealthCheckProperty
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
CfnContainerGroupDefinition.ContainerHealthCheckProperty.Jsii$Proxy
- Enclosing class:
CfnContainerGroupDefinition
When health check properties are set in a container definition, they override any Docker health checks in the container image. For more information on container health checks, see HealthCheck command in the Amazon Elastic Container Service API .
The following example instructions tell the container to wait 100 seconds after launch before counting failed health checks, then initiate the health check command every 60 seconds. After issuing the health check command, wait 10 seconds for it to succeed. If it fails, retry the command 3 times before considering the container to be unhealthy.
{"Command": [ "CMD-SHELL", "ps cax | grep "processmanager" || exit 1" ], "Interval": 300, "Timeout": 30, "Retries": 5, "StartPeriod": 100 }
Part of: ContainerDefinition$HealthCheck
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.gamelift.*; ContainerHealthCheckProperty containerHealthCheckProperty = ContainerHealthCheckProperty.builder() .command(List.of("command")) // the properties below are optional .interval(123) .retries(123) .startPeriod(123) .timeout(123) .build();
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forCfnContainerGroupDefinition.ContainerHealthCheckProperty
static final class
An implementation forCfnContainerGroupDefinition.ContainerHealthCheckProperty
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
A string array that specifies the command that the container runs to determine if it's healthy.default Number
The time period (in seconds) between each health check.default Number
The number of times to retry a failed health check before the container is considered unhealthy.default Number
The optional grace period (in seconds) to give a container time to bootstrap before the first failed health check counts toward the number of retries.default Number
The time period (in seconds) to wait for a health check to succeed before a failed health check is counted.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getCommand
A string array that specifies the command that the container runs to determine if it's healthy.- See Also:
-
getInterval
The time period (in seconds) between each health check.- See Also:
-
getRetries
The number of times to retry a failed health check before the container is considered unhealthy.The first run of the command does not count as a retry.
- See Also:
-
getStartPeriod
The optional grace period (in seconds) to give a container time to bootstrap before the first failed health check counts toward the number of retries.- See Also:
-
getTimeout
The time period (in seconds) to wait for a health check to succeed before a failed health check is counted.- See Also:
-
builder
@Stability(Stable) static CfnContainerGroupDefinition.ContainerHealthCheckProperty.Builder builder()
-