Experimental
@aws-cdk/aws-apprunner-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
HttpHealthCheckOptions Struct
Properties used to define HTTP Based healthchecks.
Example
ts
new apprunner.Service(this, 'Service', {
source: apprunner.Source.fromEcrPublic({
imageConfiguration: { port: 8000 },
imageIdentifier: 'public.ecr.aws/aws-containers/hello-app-runner:latest',
}),
healthCheck: apprunner.HealthCheck.http({
healthyThreshold: 5,
interval: Duration.seconds(10),
path: '/',
timeout: Duration.seconds(10),
unhealthyThreshold: 10,
}),
});
python
apprunner.Service(self, "Service",
source=apprunner.Source.from_ecr_public(
image_configuration=apprunner.ImageConfiguration(port=8000),
image_identifier="public.ecr.aws/aws-containers/hello-app-runner:latest"
),
health_check=apprunner.HealthCheck.http(
healthy_threshold=5,
interval=Duration.seconds(10),
path="/",
timeout=Duration.seconds(10),
unhealthy_threshold=10
)
)
java
Service.Builder.create(this, "Service")
.source(Source.fromEcrPublic(EcrPublicProps.builder()
.imageConfiguration(ImageConfiguration.builder().port(8000).build())
.imageIdentifier("public.ecr.aws/aws-containers/hello-app-runner:latest")
.build()))
.healthCheck(HealthCheck.http(HttpHealthCheckOptions.builder()
.healthyThreshold(5)
.interval(Duration.seconds(10))
.path("/")
.timeout(Duration.seconds(10))
.unhealthyThreshold(10)
.build()))
.build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.AppRunner.Alpha
new Service(this, "Service", new ServiceProps {
Source = Source.FromEcrPublic(new EcrPublicProps {
ImageConfiguration = new ImageConfiguration { Port = 8000 },
ImageIdentifier = "public.ecr.aws/aws-containers/hello-app-runner:latest"
}),
HealthCheck = HealthCheck.Http(new HttpHealthCheckOptions {
HealthyThreshold = 5,
Interval = Duration.Seconds(10),
Path = "/",
Timeout = Duration.Seconds(10),
UnhealthyThreshold = 10
})
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdkapprunneralpha/v2
apprunner.NewService(this, jsii.String("Service"), &ServiceProps{
Source: apprunner.Source_FromEcrPublic(&EcrPublicProps{
ImageConfiguration: &ImageConfiguration{
Port: jsii.Number(8000),
},
ImageIdentifier: jsii.String("public.ecr.aws/aws-containers/hello-app-runner:latest"),
}),
HealthCheck: apprunner.HealthCheck_Http(&HttpHealthCheckOptions{
HealthyThreshold: jsii.Number(5),
Interval: awscdk.Duration_Seconds(jsii.Number(10)),
Path: jsii.String("/"),
Timeout: awscdk.Duration_*Seconds(jsii.Number(10)),
UnhealthyThreshold: jsii.Number(10),
}),
})
Properties
healthyThresholdoptionalnumberhealthy_thresholdoptionalint | floathealthyThresholdoptionalNumberHealthyThresholdoptionaldoubleHealthyThresholdoptional*float64= 1#The number of consecutive checks that must succeed before App Runner decides that the service is healthy.
intervaloptionalDurationintervaloptionalDurationintervaloptionalDurationIntervaloptionalDurationIntervaloptionalDuration= Duration.seconds(5)#The time interval, in seconds, between health checks.
The URL that health check requests are sent to.
timeoutoptionalDurationtimeoutoptionalDurationtimeoutoptionalDurationTimeoutoptionalDurationTimeoutoptionalDuration= Duration.seconds(2)#The time, in seconds, to wait for a health check response before deciding it failed.
unhealthyThresholdoptionalnumberunhealthy_thresholdoptionalint | floatunhealthyThresholdoptionalNumberUnhealthyThresholdoptionaldoubleUnhealthyThresholdoptional*float64= 5#The number of consecutive checks that must fail before App Runner decides that the service is unhealthy.