google_ compute_ forwarding_ rule cost estimation
A regional forwarding rule is where the Cloud Load Balancing charge lands. It bills an hourly rate per rule plus per-GB data processed, on top of the backends behind it.
A google_
The charge has two parts. First, an hourly rate for each forwarding rule that exists, prorated to the second, whether or not traffic flows. Second, a per-GB charge on inbound data processed by the load balancer. On the network passthrough load balancer the model differs slightly, but the principle holds: the forwarding rule, not the backend service, is the billed object for the load balancer layer. Internal forwarding rules for internal load balancers are billed similarly.
Beyond the load balancer charge, the backends carry their own cost, the VMs or services behind the rule, plus the egress they generate. A static external IP reserved for the rule is free while in use by a forwarding rule but billable if reserved and unused. c3x prices the forwarding rule's hourly and data-processing charges and the backends behind it, and treats the proxy, URL map, and health checks as the free routing config they are.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "google_compute_forwarding_rule" "app" {
name = "app-fr"
region = "us-central1"
load_balancing_scheme = "EXTERNAL_MANAGED"
port_range = "80"
target = google_compute_target_http_proxy.app.id
ip_address = google_compute_address.app.address
}Pricing dimensions
What you actually pay for when you provision google_.
| Dimension | Unit | What's being charged |
|---|---|---|
| Forwarding rule (hourly) | per hour | An hourly charge for each forwarding rule that exists, prorated to the second, regardless of traffic. ~$0.025/hour per rule |
| Data processed | per GB | Per-GB charge on inbound data the load balancer processes through the rule. ~$0.008-$0.012/GB |
| Backends | per hour | The VMs or services behind the rule, which carry their own compute cost and generate egress. |
Optimization tips
Common ways to reduce google_ cost without changing the workload.
Minimize the number of forwarding rules
One hourly charge instead of manyEach rule adds an hourly charge. Serving multiple ports or paths through one rule and a URL map avoids paying for several rules where one suffices.
Do not leave orphaned rules running
A forwarding rule bills hourly whether or not it serves traffic. Deleting rules for retired services stops a charge that would otherwise run indefinitely.
Watch data-processing on high-volume traffic
The per-GB data-processing charge scales with throughput. For very high volume, Cloud CDN on the backend service can offload cacheable bytes and reduce processed data.
FAQ
Does a forwarding rule cost money?
Yes. The forwarding rule is where the Cloud Load Balancing charge lands: an hourly rate per rule plus a per-GB data-processing charge. The backend service, URL map, and health checks are free config.
Am I charged for a forwarding rule with no traffic?
Yes, for the hourly component. Each forwarding rule bills per second it exists regardless of traffic. The per-GB data-processing charge only applies when traffic flows.
How do I estimate the cost of a regional load balancer?
Price the forwarding rule's hourly charge plus expected data processed per GB, then add the backends behind it. c3x does this and treats the proxy, URL map, and health checks as free.
Related resources
google_ compute_ backend_ serviceThe free routing target the forwarding rule points at.
google_ compute_ global_ forwarding_ ruleThe global load balancer equivalent for global external and internal schemes.
google_ compute_ addressThe IP address the forwarding rule binds, free while in use.
More Google Cloud resources
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including google_.