HealthCheck

class aws_cdk.aws_apprunner_alpha.HealthCheck(*args: Any, **kwargs)

Bases: object

(experimental) Contains static factory methods for creating health checks for different protocols.

Stability:

experimental

ExampleMetadata:

infused

Example:

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
    )
)

Methods

bind()
Stability:

experimental

Return type:

HealthCheckConfigurationProperty

Attributes

health_check_protocol_type

experimental

Type:

stability

healthy_threshold

experimental

Type:

stability

interval

experimental

Type:

stability

path

experimental

Type:

stability

timeout

experimental

Type:

stability

unhealthy_threshold

experimental

Type:

stability

Static Methods

classmethod http(*, healthy_threshold=None, interval=None, path=None, timeout=None, unhealthy_threshold=None)

(experimental) Construct a HTTP health check.

Parameters:
  • healthy_threshold (Union[int, float, None]) – (experimental) The number of consecutive checks that must succeed before App Runner decides that the service is healthy. Default: 1

  • interval (Optional[Duration]) – (experimental) The time interval, in seconds, between health checks. Default: Duration.seconds(5)

  • path (Optional[str]) – (experimental) The URL that health check requests are sent to. Default: /

  • timeout (Optional[Duration]) – (experimental) The time, in seconds, to wait for a health check response before deciding it failed. Default: Duration.seconds(2)

  • unhealthy_threshold (Union[int, float, None]) – (experimental) The number of consecutive checks that must fail before App Runner decides that the service is unhealthy. Default: 5

Stability:

experimental

Return type:

HealthCheck

classmethod tcp(*, healthy_threshold=None, interval=None, timeout=None, unhealthy_threshold=None)

(experimental) Construct a TCP health check.

Parameters:
  • healthy_threshold (Union[int, float, None]) – (experimental) The number of consecutive checks that must succeed before App Runner decides that the service is healthy. Default: 1

  • interval (Optional[Duration]) – (experimental) The time interval, in seconds, between health checks. Default: Duration.seconds(5)

  • timeout (Optional[Duration]) – (experimental) The time, in seconds, to wait for a health check response before deciding it failed. Default: Duration.seconds(2)

  • unhealthy_threshold (Union[int, float, None]) – (experimental) The number of consecutive checks that must fail before App Runner decides that the service is unhealthy. Default: 5

Stability:

experimental

Return type:

HealthCheck