HttpHealthCheck

A health check for a managed instance group.

Like all Resources, this class configures itself across multiple Environments.

For more information see the official documentation.

Example Usage

Basic Usage

1
import launchflow as lf
2
3
health_check = lf.gcp.HttpHealthCheck("health-check")

With customization

1
import launchflow as lf
2
3
health_check = lf.gcp.HttpHealthCheck(
4
"health-check",
5
request_path="/healthz",
6
port=8080,
7
check_interval_sec=10,
8
timeout_sec=10,
9
healthy_threshold=3,
10
unhealthy_threshold=4,
11
)

initialization

Create a new HttpHealthCheck.

Args:

  • name (str): The name of the health check.
  • check_interval_sec (int): How often to check the health of the backend.
  • timeout_sec (int): How long to wait for a response before failing the check.
  • healthy_threshold (int): How many successful checks before marking the backend as healthy.
  • unhealthy_threshold (int): How many failed checks before marking the backend as unhealthy.
  • host (str): The host header to send with the request. Defauls to the VM attached to the instance.
  • request_path (str): The path to send the request to. Defaults to /.
  • port (int): The port to send the request to. Defaults to 80.
  • response (str): The expected response from the backend. Defaults to None.
  • proxy_header (str): The proxy header to send with the request. Defaults to None.
  • port_specification (str): The port specification to use. Defaults to None.