google_ compute_ instance cost estimation
A Google Compute Engine VM. Priced per second by machine type, region, and license. Sustained-use discounts apply automatically.
A google_
First, machine types fall into families (e2, n2, n2d, c2, c3, t2d, etc.) priced by predefined size or by custom CPU+memory configuration. Custom machine types let you pay only for the exact CPU and memory you need; this is unique to GCP and often the cheapest path.
Second, sustained-use discounts (SUD) are automatic. A VM that runs more than 25% of the month gets a tiered discount that climbs to 30% off if it runs the entire month. No commitment required. c3x applies these automatically when estimating monthly cost.
Third, Committed Use Discounts (CUD) require a 1-year or 3-year commitment but cut prices by 37% to 70%. Set purchaseOption: 'cud_
Persistent Disks (boot and additional) are billed per GB-month at rates that depend on the disk type (pd-standard, pd-balanced, pd-ssd, hyperdisk). Egress to the internet is usage-based and modeled via c3x-usage.yml.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "google_compute_instance" "api" {
name = "api-server"
machine_type = "e2-standard-4"
zone = "us-central1-a"
boot_disk {
initialize_params {
image = "debian-cloud/debian-12"
size = 100
type = "pd-balanced"
}
}
network_interface {
network = "default"
access_config {}
}
}Pricing dimensions
What you actually pay for when you provision google_.
| Dimension | Unit | What's being charged |
|---|---|---|
| Instance hours | per hour | On-demand rate for the machine type. Sustained-use discounts apply automatically to monthly estimates. $0.134/hour for e2-standard-4 in us-central1 |
| Boot disk | per GB-month | Provisioned size of the boot disk. Type (pd-standard, pd-balanced, pd-ssd, hyperdisk) determines the per-GB rate. $0.10/GB-month for pd-balanced in us-central1 |
| Additional persistent disks | per GB-month | Same per-GB rate as the boot disk. Hyperdisk has separate per-IOPS and per-MBps charges. |
| Network egress to internet | per GB | Bytes leaving Google's network to the public internet. First 200 GB/month free at the project level. Premium tier (default) and Standard tier have different rates. |
Optimization tips
Common ways to reduce google_ cost without changing the workload.
Use E2 family for general workloads
20-30%The E2 family is GCP's cost-optimized general-purpose family, typically 20-30% cheaper than N1/N2 at the same vCPU/memory ratio. Right default for web apps, APIs, and most backends.
Use custom machine types instead of predefined
Workload-dependent, 10-20%If your workload needs an unusual CPU-to-memory ratio (e.g., 2 vCPU and 16 GB RAM), a custom machine type can be cheaper than the nearest predefined size that overprovisions one dimension.
Commit to 1-year or 3-year usage
37-70%Committed Use Discounts cut prices by 37% (1-year) to 70% (3-year). Model with purchaseOption: 'cud_
Switch to Spot VMs for fault-tolerant workloads
60-91%Spot VMs cost 60-91% less than on-demand. They can be preempted with 30 seconds notice. Right for batch jobs, CI runners, and any work that tolerates interruption.
FAQ
Does c3x apply Sustained Use Discounts?
Yes. SUDs are applied automatically when c3x calculates monthly cost (730 hours of usage), reducing on-demand pricing by up to 30%. The output shows the discounted rate.
How does c3x handle custom machine types?
c3x reads machine_
What about Spot VMs?
Set scheduling { provisioning_
Does c3x include premium tier vs standard tier networking?
Egress pricing differs between Premium and Standard network tiers. c3x defaults to Premium (the GCP default). Override via c3x-usage.yml if your VMs use Standard tier.
Related resources
More Google Cloud resources
Further reading
- The cheapest GCP region: placing workloads for lowest cost
GCP prices Compute Engine and other services differently by region, with US regions often cheapest. Choosing a low-cost region for latency-tolerant workloads is simple savings. Here is how to find and use the cheapest GCP region.
- GCP Batch cost: free service, you pay for the compute it schedules
GCP Batch adds no charge of its own; you pay for the Compute Engine VMs it runs your jobs on, including Spot. Spot workers, right-sized machines, and jobs that scale to zero are the levers. Here is how to run batch cheaply.
- GCP Cloud Workstations cost: pay per hour a workstation runs
Cloud Workstations bills a management fee plus the underlying Compute Engine VM and storage while a workstation runs, with auto-shutdown when idle. Idle workstations left running are the classic waste. Here is the model and how to control it.
- GCP committed use discounts explained: how CUDs cut your bill
Google Cloud committed use discounts (CUDs) cut compute and other costs by roughly 20 to 57 percent in exchange for a one or three year commitment. Resource-based and spend-based CUDs work differently. Here is how CUDs work and when they save the most.
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_.