@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.726Z") @Stability(value=Stable) public interface HealthCheck extends software.amazon.jsii.JsiiSerializable
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();
| Modifier and Type | Interface and Description |
|---|---|
static class |
HealthCheck.Builder
A builder for
HealthCheck |
static class |
HealthCheck.Jsii$Proxy
An implementation for
HealthCheck |
| Modifier and Type | Method and Description |
|---|---|
static HealthCheck.Builder |
builder() |
List<String> |
getCommand()
A string array representing the command that the container runs to determine if it is healthy.
|
default Duration |
getInterval()
The time period in seconds between each health check execution.
|
default Number |
getRetries()
The number of times to retry a failed health check before the container is considered unhealthy.
|
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.
|
default Duration |
getTimeout()
The time period in seconds to wait for a health check to succeed before it is considered a failure.
|
@Stability(value=Stable) @NotNull List<String> getCommand()
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" ]
@Stability(value=Stable) @Nullable default Duration getInterval()
You may specify between 5 and 300 seconds.
Default: Duration.seconds(30)
@Stability(value=Stable) @Nullable default Number getRetries()
You may specify between 1 and 10 retries.
Default: 3
@Stability(value=Stable) @Nullable default Duration getStartPeriod()
You may specify between 0 and 300 seconds.
Default: No start period
@Stability(value=Stable) @Nullable default Duration getTimeout()
You may specify between 2 and 60 seconds.
Default: Duration.seconds(5)
@Stability(value=Stable) static HealthCheck.Builder builder()
HealthCheck.Builder of HealthCheckCopyright © 2022. All rights reserved.