Configure a global Cloud Load Balancing backend service

You create a load balancer in your application by configuring and connecting distinct Cloud Load Balancing frontend and backend components, which help you apply separate controls for external and internal traffic and prevent direct access to data. In Application Design Center, the global Cloud Load Balancing backend service component manages traffic distribution settings—including protocols, session affinity, health checks, and timeouts—for serverless network endpoint groups (NEGs) and Compute Engine managed instance groups (MIGs), with connections and configuration parameters based on the terraform-google-lb-http Terraform module on GitHub.

Component connections

To create a complete Cloud Load Balancing component, connect your global Cloud Load Balancing backend to at least one global Cloud Load Balancing frontend. Connected Cloud Load Balancing components are displayed as a group in the design canvas.

The following table lists the components that you connect to a global Cloud Load Balancing backend, and the resulting updates to your application and its generated Terraform code.

Connected component Application updates Background information

Cloud Run

  • The load balancer can distribute incoming traffic to the Cloud Run service.
  • The Cloud Run service is added as a backend endpoint in the Cloud Load Balancing serverless NEG backends configuration.
Set up a global external Application Load Balancer with Cloud Run

Global Cloud Load Balancing frontend (required)

  • The Cloud Load Balancing frontend, which handles incoming requests, is linked to the Cloud Load Balancing backend, which processes the requests.
  • The backend service information is added to the frontend URL map input.
URL maps overview

Compute Engine MIG

  • The load balancer can distribute incoming traffic to the Compute Engine MIG.
  • The Compute Engine MIG is added to the Cloud Load Balancing backend service groups field.
Set up a classic Application Load Balancer with a managed instance group backend

Required configuration parameters

If your template includes a global Cloud Load Balancing backend component, configure the following parameters before you deploy.

Parameter name Description and constraints Background information

Name

Name for the load balancer backend service. name

Project ID

The project where you want to deploy the Cloud Load Balancing backend service.

Configure components

Optional configuration parameters

The following parameters are optional. To display advanced parameters, in the Configuration area, select Show advanced fields.

Feature Parameter name Description and constraint information Background information
Host Path Mappings Host Configure URL maps Use URL maps
Host Path Mappings Path Configure URL maps Use URL maps
Load Balancing Scheme loadBalancingScheme Backend services overview
Protocol protocol Protocol to the backends
Port Name portName Named ports
Description A description for the backend service. description
Enable CDN enableCDN Cloud CDN overview
Compression Mode compressionMode Compression isn't working
Custom Request Headers customRequestHeaders[] Create custom headers in backend services
Custom Response Headers customResponseHeaders[] Create custom headers in backend services
Connection Draining Timeout Sec connectionDraining.drainingTimeoutSec Enable connection draining
Session Affinity sessionAffinity Session affinity
Affinity Cookie TTL Sec affinityCookieTtlSec Generated cookie affinity
Locality LB Policy localityLbPolicy Load balancing locality policy
Timeout Sec timeoutSec Backend service timeout
Log config Enable logConfig.enable Logging
Log config Sample Rate logConfig.sampleRate Logging
Groups Group backends[].group Backends
Groups Description A description for the backends group. backends[].description
Groups Balancing Mode backends[].balancingMode Balancing modes and target capacity settings
Groups Capacity Scaler backends[].capacityScaler Capacity scaler
Groups Max Connections backends[].maxConnections Connection balancing mode
Groups Max Connections Per Instance backends[].maxConnectionsPerInstance Connection balancing mode
Groups Max Connections Per Endpoint backends[].maxConnectionsPerEndpoint Connection balancing mode
Groups Max Rate backends[].maxRate Rate balancing mode
Groups Max Rate Per Instance backends[].maxRatePerInstance Rate balancing mode
Groups Max Rate Per Endpoint backends[].maxRatePerEndpoint Rate balancing mode
Groups Max Utilization backends[].maxUtilization Utilization balancing mode
Serverless NEG backends Region region Serverless network endpoint groups overview
Serverless NEG backends Type The type of serverless backend. Possible values include cloud-run, cloud-function, or app-engine. Supported load balancers
Serverless NEG backends Service Name appEngine.service Serverless network endpoint groups overview
Serverless NEG backends Service Version appEngine.version Serverless network endpoint groups overview
Identity-Aware Proxy (IAP) Config Enable iap.enabled IAP overview
IAP Config OAuth2 Client ID iap.oauth2ClientId How to share OAuth clients
IAP Config OAuth2 Client Secret iap.oauth2ClientSecret How to share OAuth clients
CDN Policy Cache Mode cdnPolicy.cacheMode Caching overview
CDN Policy Signed URL Cache Max Age Sec cdnPolicy.signedUrlCacheMaxAgeSec Customize the maximum cache time
CDN Policy Default TTL cdnPolicy.defaultTtl Change TTL settings and overrides
CDN Policy Max TTL cdnPolicy.maxTtl Change TTL settings and overrides
CDN Policy Client TTL cdnPolicy.clientTtl Change TTL settings and overrides
CDN Policy Negative Caching cdnPolicy.negativeCaching Use negative caching
CDN Policy Serve While Stale cdnPolicy.serveWhileStale Serving stale content
CDN Policy Bypass Cache on Request Headers cdnPolicy.bypassCacheOnRequestHeaders[] Bypassing cache
Negative Caching Policy Code cdnPolicy.negativeCachingPolicy[].code Use negative caching
Negative Caching Policy TTL cdnPolicy.negativeCachingPolicy[].ttl Use negative caching
Cache Key Policy Include Host cdnPolicy.cacheKeyPolicy.includeHost Cache keys
Cache Key Policy Include Protocol cdnPolicy.cacheKeyPolicy.includeProtocol Cache keys
Cache Key Policy Include Query String cdnPolicy.cacheKeyPolicy.includeQueryString Query string include list
Cache Key Policy Query String Blacklist cdnPolicy.cacheKeyPolicy.queryStringBlacklist[] Query string exclude list
Cache Key Policy Query String Whitelist cdnPolicy.cacheKeyPolicy.queryStringWhitelist[] Query string include list
Cache Key Policy Include HTTP Headers cdnPolicy.cacheKeyPolicy.includeHttpHeaders[] HTTP headers and HTTP cookies cache key settings
Cache Key Policy Include Named Cookies cdnPolicy.cacheKeyPolicy.includeNamedCookies[] Include named cookies
Outlier Detection Base Ejection Time Seconds outlierDetection.baseEjectionTime.seconds Outlier detection for serverless NEGs
Outlier Detection Base Ejection Time Nanos outlierDetection.baseEjectionTime.nanos Outlier detection for serverless NEGs
Outlier Detection Consecutive Errors outlierDetection.consecutiveErrors Outlier detection for serverless NEGs
Outlier Detection Consecutive Gateway Failure outlierDetection.consecutiveGatewayFailure Outlier detection for serverless NEGs
Outlier Detection Enforcing Consecutive Errors outlierDetection.enforcingConsecutiveErrors Outlier detection for serverless NEGs
Outlier Detection Enforcing Consecutive Gateway Failure outlierDetection.enforcingConsecutiveGatewayFailure Outlier detection for serverless NEGs
Outlier Detection Enforcing Success Rate outlierDetection.enforcingSuccessRate Outlier detection for serverless NEGs
Outlier Detection Interval Seconds outlierDetection.interval.seconds Outlier detection for serverless NEGs
Outlier Detection Interval Nanos outlierDetection.interval.nanos Outlier detection for serverless NEGs
Outlier Detection Max Ejection Percent outlierDetection.maxEjectionPercent Outlier detection for serverless NEGs
Outlier Detection Success Rate Minimum Hosts outlierDetection.successRateMinimumHosts Outlier detection for serverless NEGs
Outlier Detection Success Rate Request Volume outlierDetection.successRateRequestVolume Outlier detection for serverless NEGs
Outlier Detection Success Rate Stdev Factor outlierDetection.successRateStdevFactor Outlier detection for serverless NEGs
Health Check Host http2HealthCheck.host Additional flags for HTTP, HTTPS, and HTTP/2 health checks
Health Check Request Path http2HealthCheck.requestPath Success criteria for HTTP, HTTPS, and HTTP/2
Health Check Request sslHealthCheck.request Success criteria for SSL and TCP
Health Check Response sslHealthCheck.response Additional flags for HTTP, HTTPS, and HTTP/2 health checks
Health Check Port http2HealthCheck.port Health check categories, protocols, and ports
Health Check Port Name http2HealthCheck.portName Named ports
Health Check Proxy Header http2HealthCheck.proxyHeader Headers
Health Check Port Specification http2HealthCheck.portSpecification Port specification flags
Health Check Protocol type Health check categories, protocols, and ports
Health Check Check Interval Sec checkIntervalSec Probes
Health Check Timeout Sec timeoutSec Probes
Health Check Healthy Threshold healthyThreshold Health state
Health Check Unhealthy Threshold unhealthyThreshold Health state
Health Check Logging logConfig.enable Health check logging information
Edge Security Policy edge_security_policy Edge security policies
Security Policy security_policy Security policy overview
Firewall Networks network Configure firewall rules
Firewall Projects Names of the projects to create firewall rules in. Configure firewall rules
Target Tags targetTags[] Restrict which clients can send traffic to the load balancer
Target Service Accounts targetServiceAccounts[] Source and target filtering by service account

What's next

Connect your backend component to a frontend component. To configure the frontend component, see Configure a global Cloud Load Balancing frontend.