GCLOUD_COMPUTE_BACKEND-SERVICES_CREATE(1)

NAME

gcloud compute backend-services create - create a backend service

SYNOPSIS

gcloud compute backend-services create BACKEND_SERVICE_NAME [--affinity-cookie-ttl=AFFINITY_COOKIE_TTL] [--no-cache-key-include-host] [--no-cache-key-include-protocol] [--no-cache-key-include-query-string] [--connection-draining-timeout=CONNECTION_DRAINING_TIMEOUT] [--description=DESCRIPTION] [--enable-cdn] [--health-checks=HEALTH_CHECK,[HEALTH_CHECK,...]] [--http-health-checks=HTTP_HEALTH_CHECK,[HTTP_HEALTH_CHECK,...]] [--https-health-checks=HTTPS_HEALTH_CHECK,[HTTPS_HEALTH_CHECK,...]] [--iap=disabled|enabled,[oauth2-client-id=OAUTH2-CLIENT-ID,oauth2-client-secret=OAUTH2-CLIENT-SECRET]] [--load-balancing-scheme=LOAD_BALANCING_SCHEME; default="EXTERNAL"] [--port=PORT] [--port-name=PORT_NAME] [--protocol=PROTOCOL] [--session-affinity=SESSION_AFFINITY] [--timeout=TIMEOUT; default="30s"] [--cache-key-query-string-blacklist=[QUERY_STRING,...] | --cache-key-query-string-whitelist=QUERY_STRING,[QUERY_STRING,...]] [--global | --region=REGION] [GCLOUD_WIDE_FLAG ...]

DESCRIPTION
gcloud compute backend-services create is used to create backend services. Backend services define groups of backends that can receive traffic. Each backend group has parameters that define the group's capacity (e.g. max CPU utilization, max queries per second, ...). URL maps define which requests are sent to which backend services. Backend services created through this command will start out without any backend groups. To add backend groups, use 'gcloud compute backend-services add-backend' or 'gcloud compute backend-services edit'.

POSITIONAL ARGUMENTS

    BACKEND_SERVICE_NAME
        The name of the backend service to create.

FLAGS

    --affinity-cookie-ttl=AFFINITY_COOKIE_TTL
        If session-affinity is set to "generated_cookie", this flag sets the TTL, in seconds, of the resulting cookie. A setting of 0 indicates that the cookie should be transient.

    --cache-key-include-host
        Enable including host in cache key. If enabled, requests to different hosts will be cached separately. Can only be applied for global resources. Enabled by default, use --no-cache-key-include-host to disable.

    --cache-key-include-protocol
        Enable including protocol in cache key. If enabled, http and https requests will be cached separately. Can only be applied for global resources. Enabled by default, use --no-cache-key-include-protocol to disable.

    --cache-key-include-query-string
        Enable including query string in cache key. If enabled, the query string parameters will be included according to --cache-key-query-string-whitelist and --cache-key-query-string-blacklist. If neither is set, the entire query string will be included. If disabled, then the entire query string will be excluded. Can only be applied for global resources. Enabled by default, use --no-cache-key-include-query-string to disable.

    --connection-draining-timeout=CONNECTION_DRAINING_TIMEOUT
        Connection draining timeout to be used during removal of VMs from instance groups. This guarantees that for the specified time all existing connections to a VM will remain untouched, but no new connections will be accepted. Set timeout to zero to disable connection draining. Enable feature by specifying a timeout of up to one hour. If the flag is omitted API default value (0s) will be used. Valid units for this flag are s for seconds, m for minutes, and h for hours.

    --description=DESCRIPTION
        An optional, textual description for the backend service.

    --enable-cdn
        Enable Cloud CDN for the backend service. Cloud CDN can cache HTTP responses from a backend service at the edge of the network, close to users. Cloud CDN is disabled by default.

    --health-checks=HEALTH_CHECK,[HEALTH_CHECK,...]
        Specifies a list of health check objects for checking the health of the backend service. Health checks need not be for the same protocol as that of the backend service.

    --http-health-checks=HTTP_HEALTH_CHECK,[HTTP_HEALTH_CHECK,...]
        Specifies a list of HTTP health check objects for checking the health of the backend service.

    --https-health-checks=HTTPS_HEALTH_CHECK,[HTTPS_HEALTH_CHECK,...]
        Specifies a list of HTTPS health check objects for checking the health of the backend service.

    --iap=disabled|enabled,[oauth2-client-id=OAUTH2-CLIENT-ID,oauth2-client-secret=OAUTH2-CLIENT-SECRET]
        Configure Identity Aware Proxy (IAP) service. You can configure IAP to be 'enabled' or 'disabled' (default). If it is enabled you can provide values for 'oauth2-client-id' and 'oauth2-client-secret'. For example, '--iap=enabled,oauth2-client-id=foo,oauth2-client-secret=bar' will turn IAP on, and '--iap=disabled' will turn it off. See https://cloud.google.com/iap/ for more information about this feature.

    --load-balancing-scheme=LOAD_BALANCING_SCHEME; default="EXTERNAL"
        Specifies if this is internal or external load balancer. LOAD_BALANCING_SCHEME must be one of: INTERNAL, EXTERNAL.

    --port=PORT
        The TCP port to use when connecting to the backend. --port is being deprecated in favor of --port-name.

    --port-name=PORT_NAME
        The name of a service that has been added to an instance group in this backend. Instance group services map a name to a port number which is used by the load balancing service. Only one port-name may be added to a backend service, and that name must exist as a service on all instance groups that are a part of this backend service. The port number associated with the name may differ between instances. If you do not specify this flag, your instance groups must have a service named http configured. See also gcloud compute instance-groups set-named-ports --help.

    --protocol=PROTOCOL
        The protocol for incoming requests. PROTOCOL must be one of: HTTP, HTTPS, SSL, TCP, UDP.

    --session-affinity=SESSION_AFFINITY
        The type of session affinity to use for this backend service. SESSION_AFFINITY must be one of:

        CLIENT_IP
            Route requests to instances based on the hash of the client's IP address.

        GENERATED_COOKIE
            Route requests to instances based on the contents of the "GCLB" cookie set by the load balancer.

        NONE
            Session affinity is disabled.

    --timeout=TIMEOUT; default="30s"
        The amount of time to wait for a backend to return a full response for the request and for the load balancer to proxy the response to the client before considering the request failed. For example, specifying 10s gives instances 10 seconds to respond to requests. The load balancer will retry GET requests once if the backend closes the connection or times out before sending response headers to the proxy. If the backend produces any response headers, the load balancer does not retry. If the backend does not reply at all, the load balancer returns a 502 Bad Gateway error to the client. Valid units for this flag are s for seconds, m for minutes, and h for hours.

At most one of these may be specified:

    --cache-key-query-string-blacklist=[QUERY_STRING,...]
        Specifies a comma separated list of query string parameters to exclude in cache keys. All other parameters will be included. Either specify --cache-key-query-string-whitelist or --cache-key-query-string-blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. Can only be applied for global resources.

    --cache-key-query-string-whitelist=QUERY_STRING,[QUERY_STRING,...]
        Specifies a comma separated list of query string parameters to include in cache keys. All other parameters will be excluded. Either specify --cache-key-query-string-whitelist or --cache-key-query-string-blacklist, not both. '&' and '=' will be percent encoded and not treated as delimiters. Can only be applied for global resources.

At most one of these may be specified:

    --global
        If provided, it is assumed the backend service is global.

    --region=REGION
        The region of the backend service to create. Overrides the default compute/region property value for this command invocation.

GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.