Configure a regional 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 regional Cloud Load Balancing backend service component provides fine-grained control over 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-regional-lb-http Terraform module on GitHub.

Component connections

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

The following table includes the components that you can connect to a regional 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 regional external Application Load Balancer with Cloud Run

Regional 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 regional external Application Load Balancer with VM instance group backends

Required configuration parameters

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

Parameter name Description and constraints Background information

Project ID

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

Configure components

Region

The region where the load balancer backend service is created. region

Name

Name for the load balancer backend service. name

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 URL maps overview
Host Path Mappings

Path

Configure URL maps URL maps overview
Load Balancing Scheme loadBalancingScheme Backend services overview
Serverless NEG backends Region region Serverless network endpoint groups overview
Serverless NEG backends Type networkEndpointType Serverless network endpoint groups overview
Serverless NEG backends Service Name appEngine.service Serverless network endpoint groups overview
Serverless NEG backends Service Version appEngine.version Serverless network endpoint groups overview
Serverless NEG backends Capacity Scaler backends[].capacityScaler Capacity scaler
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
Protocol protocol Protocol to the backends
Port Name portName Named ports
Description A description for the backend service. description
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 The protocol that Google Cloud uses to probe the backends. For example, http2. 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
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
Firewall Source Ranges sourceRanges[] Configure firewall rules
Connection Draining Timeout Sec connectionDraining.drainingTimeoutSec Enable connection draining
Enable CDN enableCDN Cloud CDN overview
Session Affinity sessionAffinity Session affinity
Affinity Cookie TTL Sec affinityCookieTtlSec Generated cookie affinity
Locality LB Policy localityLbPolicy Load balancing locality policy
Security Policy securityPolicy Google Cloud Armor
Timeout Sec timeoutSec Backend service timeout

What's next

You must connect your backend component to a frontend component. To configure the frontend component, see Configure a regional Cloud Load Balancing frontend.