gcloud compute health-checks create http2 NAME [--check-interval=CHECK_INTERVAL; default="5s"] [--description=DESCRIPTION] [--enable-logging] [--healthy-threshold=HEALTHY_THRESHOLD; default=2] [--host=HOST] [--proxy-header=PROXY_HEADER; default="NONE"] [--request-path=REQUEST_PATH; default="/"] [--response=RESPONSE] [--timeout=TIMEOUT; default="5s"] [--unhealthy-threshold=UNHEALTHY_THRESHOLD; default=2] [--global | --region=REGION] [--port=PORT; default=80 --port-name=PORT_NAME --use-serving-port] [GCLOUD_WIDE_FLAG …]
gcloud compute health-checks create http2 is used to create a
non-legacy health check using the HTTP/2 protocol. You can use this health check
for Google Cloud load balancers or for managed instance group autohealing. For
more information, see the health checks overview at: https://cloud.google.com/load-balancing/docs/health-check-concepts
gcloud compute health-checks create http2 my-health-check-nameNAME--check-interval=CHECK_INTERVAL; default="5s"10s will run the check every 10 seconds.
The default value is 5s. See $ gcloud topic datetimes for
information on duration formats.
--description=DESCRIPTION--enable-logging--healthy-threshold=HEALTHY_THRESHOLD; default=2--host=HOST--proxy-header=PROXY_HEADER; default="NONE"PROXY_HEADER must be one of:
NONEPROXY_V1--request-path=REQUEST_PATH; default="/"/healthcheck. The default value is
``/´´.
--response=RESPONSE--timeout=TIMEOUT; default="5s"10s will cause the check to wait for 10
seconds before considering the request a failure. The default value is
5s. See $ gcloud topic datetimes for
information on duration formats.
--unhealthy-threshold=UNHEALTHY_THRESHOLD; default=2--global--region=REGION
To avoid prompting when this flag is omitted, you can set the
property:
compute/region
gcloud config set compute/region REGIONA list of regions can be fetched by running:
gcloud compute regions listTo unset the property, run:
gcloud config unset compute/regionCLOUDSDK_COMPUTE_REGION.
These flags configure the port that the health check monitors. If none is
specified, the default port of 80 is used. If both --port and
--port-name are specified, --port takes precedence.
--port=PORT; default=80--port-name=PORT_NAME--use-serving-port--use-serving-port must be used when
using a Network Endpoint Group as a backend as this flag specifies the
portSpecification option for a Health Check object.
--access-token-file,
--account, --billing-project,
--configuration,
--flags-file,
--flatten, --format, --help, --impersonate-service-account,
--log-http,
--project, --quiet, --trace-token, --user-output-enabled,
--verbosity.
Run $ gcloud help for details.
gcloud alpha compute health-checks create http2gcloud beta compute health-checks create http2gcloud preview compute health-checks create http2
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-05-27 UTC.