For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /docs/infrastructure/providers/gcp/cost-estimation.md.

GCP Cost Estimation

No fees from tsdevstack

tsdevstack is free and open source. All costs on this page are paid directly to Google Cloud. There is no bill from tsdevstack and there never will be.

These are estimates based on published GCP pricing as of July 2026 in a US region (us-central1). Actual costs depend on your region, traffic, and any pricing changes by Google. Always verify with the official pricing pages linked at the bottom.

2026 pricing pressure

The AI buildout is squeezing server hardware supply, and that is expected to reach cloud list prices in the second half of 2026. As of July 2026 the GCP rates on this page are unchanged. Server memory contract prices rose sharply through the first half of 2026, and there is typically a 6 to 9 month lag before that shows up in cloud pricing, with forecasts pointing to roughly 5-10% general increases.

On GCP the most exposed lines are Cloud SQL and Memorystore, which are priced off provisioned memory, followed by Cloud Run compute. Load balancer and Cloud Armor fees are the least exposed. If you are budgeting past Q3 2026, add a 10% buffer on the database and cache lines.


What Gets Deployed

A typical tsdevstack project (3 NestJS backends + 1 Next.js frontend) creates these billable resources on GCP:

ResourceGCP ServiceDefault Configuration
Kong gatewayCloud Run1 vCPU, 1 GiB memory, min 1 instance (always on), plus a trace collector next to it (0.25 vCPU, 256 MiB)
Backend services (x3)Cloud Run1 vCPU, 512 MiB memory, configurable min instances
FrontendCloud Run1 vCPU, 512 MiB memory, configurable min instances
SPA (react-app)GCS bucket + Cloud CDNStatic bucket, no compute
DatabaseCloud SQL PostgreSQL 15db-f1-micro, 10 GB disk
CacheMemorystore Redis 7BASIC tier, 1 GB
Load BalancerGlobal HTTPS LBStatic IP, forwarding rules
WAFCloud ArmorStandard tier, OWASP rule set
SecretsSecret Manager~10-20 secrets
DNSCloud DNS1 managed zone
Container imagesArtifact Registry~5 images
TracesCloud TraceEvery request (tracing.sampleRate 1)
DashboardCloud Monitoring1 per environment, free

You can override CPU, memory, instance counts, database tier, Redis tier, and disk size per service in infrastructure.json. See Service Configuration for all available options.


Scenario 1 — Development (Scale-to-Zero)

Backend services and frontend set to minInstances: 0 in infrastructure.json (the default is 1). Kong stays on (minInstances: 1). Messages for the backend services wait in Redis until a request starts them, which is fine for testing. Assumed traffic: ~1,000 requests/day (testing only).

ResourceConfigurationHow it's calculatedEst. monthly
Kong + collector (Cloud Run)1.25 vCPU, 1.25 GiB, min=1730 hrs idle at $0.0000025/vCPU-sec + $0.0000025/GiB-sec~$16
Backend services ×31 vCPU, 512 MiB, min=0Scaled to zero when idle — billed per request~$1-5
Frontend1 vCPU, 512 MiB, min=0Scaled to zero when idle — billed per request~$1-3
SPA bucketGCS + Cloud CDNStorage + minimal egress~$1
Cloud SQLdb-f1-micro, 10 GBShared-core instance + storage~$10
Memorystore RedisBASIC, 1 GBBilled per GiB-hour~$7
Load Balancer4 forwarding rules (IPv4 and IPv6, HTTPS and HTTP redirect), low traffic$0.025/hour covers the first 5 rules (~$18) + $0.008/GiB processed; addresses on forwarding rules are free~$18-19
Cloud Armor1 policy, ~6 WAF rules$5/policy + $1/rule + $0.75/million requests~$12
DNS, Secrets, RegistryMinimal~$0.20/zone + ~$0.06/secret-version/month~$1
Traces (Cloud Trace)~240k spansWithin the 2.5 million free spans$0
Total16 + (1-5) + (1-3) + 1 + 10 + 7 + (18-19) + 12 + 1 + 0~$67-74

Cold starts after scale-to-zero: 2-8 seconds. Cloud Run handles this natively — no wake-up mechanisms needed.

Why Kong is only ~$16

tsdevstack deploys Kong with cpuIdle: true, which is request-based billing. A minInstances: 1 instance that is not serving requests bills CPU at the reduced idle rate of $0.0000025/vCPU-second rather than the active rate of $0.000024/vCPU-second. In a dev environment the gateway sits idle nearly all month, so an always-on Kong costs far less than a full-rate calculation suggests. Kong's instance has 1.25 vCPU and 1.25 GiB: Kong's own 1 vCPU and 1 GiB, plus 0.25 vCPU and 256 MiB for the collector that sends Kong's spans to Cloud Trace.


Scenario 2 — Production (Always-On, Single Instance)

All services at minInstances: 1 (the default). Assumed traffic: ~100,000 requests/day (3M/month).

ResourceConfigurationHow it's calculatedEst. monthly
Kong + collector (Cloud Run)1.25 vCPU, 1.25 GiB, min=1Idle CPU + memory 730 hrs + active CPU for 3M requests~$22
Backend services ×31 vCPU, 512 MiB, min=1 eachInstance-based: 730 hrs × ($0.0648/vCPU-hr + 0.5 × $0.0072/GiB-hr)~$50 each, ~$150
Frontend1 vCPU, 512 MiB, min=11 instance × 730 hrs~$13
SPA bucketGCS + Cloud CDNStorage + egress~$1
Cloud SQLdb-f1-micro, 10 GBSame as dev (upgrade if needed)~$10
Memorystore RedisBASIC, 1 GBSame as dev~$7
Load Balancer4 rules, moderate traffic$18.25 for the rules + data processing~$19-21
Cloud Armor1 policy, ~6 rules$5 + $6 + 3M × $0.75/M~$13
DNS, Secrets, RegistryMinimal—~$1
Traces (Cloud Trace)~24M spans(24M - 2.5M free) × $0.20/M~$4
Total22 + 150 + 13 + 1 + 10 + 7 + (19-21) + 13 + 1 + 4~$240-242

Cloud Run has two billing modes: CPU allocated during requests (request-based) and CPU always allocated (instance-based).

  • Kong and the frontend use request-based billing. An always-on instance pays memory for the full 730 hours, CPU at the idle rate while waiting, and the active CPU rate only while serving a request. The figures above assume ~3M requests/month at roughly 150ms of CPU each. Slower or heavier requests push these lines up toward the active rate.
  • NestJS services with minInstances 1 or more use instance-based billing: CPU and memory for every second, with no per-request fee. Their CPU stays on between requests, so message handlers and background work run while no request comes in. Request-based, the same instance would be ~$13, but it would get CPU only during requests. Services with minInstances: 0 keep request-based billing.

Scenario 3 — Production Under Load (3 Instances, 24/7)

Assumed traffic: ~10M requests/day (300M/month). At this volume every service is effectively serving continuously, so CPU bills at the active rate for most of the month. Whether that arrives as 2 saturated instances or 3 at partial load barely changes the bill: what you pay for is total active vCPU-seconds, and traffic sets that.

ResourceConfigurationHow it's calculatedEst. monthly
Kong + collector (Cloud Run)1.25 vCPU, 1.25 GiB~2-3 inst, near-continuous active CPU~$175
Backend services ×31 vCPU, 512 MiB each~6-9 inst, instance-based: 730 hrs × $0.0684 each~$300-450
Frontend1 vCPU, 512 MiB~2-3 inst, near-continuous active CPU~$130
Cloud Run requests300M/month$0.40/million~$120
Cloud Armor1 policy, ~6 rules$5 + $6 + 300M × $0.75/M~$236
SPA bucketGCS + Cloud CDNStorage + egress at volume~$5-15
Cloud SQLdb-g1-small or db-n1-standard-1Upgraded tier for load~$25-50
Memorystore RedisBASIC, 1 GBSame~$7
Load BalancerHigh traffic$18.25 for the rules + ~3 TB data processing at $0.008/GiB~$40-60
DNS, Secrets, Registry——~$1
Traces (Cloud Trace)~2.4 billion spans at sampleRate 1(2,400M - 2.5M free) × $0.20/M~$480
Total~$1,520-1,725
Total with sampleRate 0.01Traces ~$4~$1,045-1,250
Per-request charges dominate at this volume

Cloud Armor bills $0.75 per million requests, so at 300M/month it alone is ~$236, more than the database, cache, and load balancer combined. Together with Cloud Run's $0.40/million, per-request fees are ~$356 of this total. Budget by requests first at this volume.

Traces are per request too. At the default tracing.sampleRate of 1 they are the largest line. Keep 1 in 100 traces ("tracing": { "sampleRate": 0.01 }) and they cost ~$4. See Traces and Dashboards.

GCP is the expensive option at this scale

Cloud Run's active CPU rate is $0.0864/vCPU-hour, which is 2.1x AWS Fargate's $0.04048. GCP is the cheapest of the three providers when your services sit idle and the most expensive when they are saturated.

Switch billing mode above ~81% utilization

Instance-based billing is a flat $0.0648/vCPU-hour, versus $0.0864 while active under request-based billing. NestJS services with minInstances 1 or more already use it. For Kong and the frontend, request-based billing costs more above ~81% utilization. Also consider Cloud Run committed use discounts (up to 17% savings).


Cloud Run Billing, and Why Kong Is Not $70

An earlier version of this page listed Kong at ~$70/month. That came from 730 hrs × ($0.0864/vCPU-hr + $0.009/GiB-hr), which applies Cloud Run's active CPU rate to every second of the month. It is not one of the two rates Cloud Run actually charges.

For 1 vCPU + 1 GiB over 730 hours:

ModeMonthly
Request-based (cpuIdle: true: Kong, the frontend, NestJS services with minInstances: 0), fully idle~$13
Instance-based (cpuIdle: false: workers, NestJS services with minInstances 1 or more), any utilization~$53
Request-based, fully saturated~$70

It is reasonable to assume Kong is expensive because every request passes through it. Kong does see 100% of traffic, but that is not what drives the bill. Kong runs with a request concurrency of 1000, and under request-based billing CPU is charged while any request is in flight, not per request. One thousand concurrent requests cost the same CPU-second as one.

So the billed fraction of the month is 1 - e^(-arrival_rate × request_duration), not the sum of request durations:

TrafficRequests/secBusyKong cost
A few per day (dev)~00%~$13
100k/day (Scenario 2)1.26%~$18
1M/day11.644%~$50
10M/day115.7100%~$189*

*Above ~10M requests/day the $0.40/million request charge overtakes compute.

Kong only reaches ~$70 at roughly 5M requests/day sustained, at which point it would have scaled past one instance anyway.

The figures above are for Kong alone. The trace collector on the same instance adds a quarter to each (0.25 vCPU and 256 MiB on top of Kong's 1 vCPU and 1 GiB).


What Drives the Cost

#Cost driverWhy
1Cloud Run computeAn always-on NestJS service is ~$50/month: its CPU stays on. Kong and the frontend are driven by request volume and duration: idle ones are cheap, busy ones are not. Scale-to-zero saves the most.
2Cloud SQL tierdb-f1-micro is cheap (~$10), but db-n1-standard-1 is ~$50. Pick based on load.
3Cloud Armor$5/policy + $1/rule adds up. Still much cheaper than Cloud Armor Enterprise ($3,000/mo).
4MemorystoreFixed cost for provisioned capacity. 1 GB BASIC is the minimum.
5Traces$0.20 per million spans after 2.5 million free. Small until traffic is high; tracing.sampleRate sets it.

How to Reduce Costs

  • Set minInstances: 0 for backend services and the frontend in dev: accept 2-8s cold starts and messages that wait for the next request, and pay near-zero for idle compute. Kong is clamped to at least 1 regardless, and production should stay at 1. See minInstances.
  • Use db-f1-micro for dev databases — upgrade only when needed
  • Right-size CPU/memory: monitor actual usage and lower from defaults if your services don't need 1 vCPU (a NestJS service with minInstances 1 or more needs 1 vCPU or more)
  • Committed use discounts: a 1-year commitment saves up to 17% on Cloud Run compute
  • Lower tracing.sampleRate in busy production environments: 0.1 keeps 1 trace in 10 and cuts the trace bill by 90%

Override any default in .tsdevstack/infrastructure.json:

{
  "version": "1.0.0",
  "dev": {
    "auth-service": {
      "minInstances": 0,
      "maxInstances": 3
    },
    "database": {
      "tier": "db-g1-small",
      "diskSize": 20
    }
  },
  "prod": {
    "tracing": { "sampleRate": 0.1 }
  }
}

See Service Configuration for all available options.


Traces and Dashboards

The trace lines above assume ~8 spans per request (Kong, the service, its database queries). A request that calls more services or runs more queries makes more spans.

ItemPriceNotes
Traces (Cloud Trace)$0.20 per million spansThe first 2.5 million spans each month are free, per billing account
Dashboard (Cloud Monitoring)FreeIts metrics are free platform metrics
Slow queries (Cloud SQL Query Insights)FreeOn by default
Reading and following logs (infra:logs, --follow)Free

tracing.sampleRate sets the share of traces kept, and the trace bill with it. See Traces and Dashboards.

Storage Access Logs

With storage buckets, every read and write of their files is logged: Cloud Storage's Data Access audit logs, in Cloud Logging. Logs of the other buckets in the project (the Terraform state, the SPA buckets) are dropped before they are stored, so they cost nothing.

ItemPriceNotes
Access logs (Cloud Logging)$0.50 per GiBThe first 50 GiB each month are free, per project, shared with every other log. Kept 30 days

Example: ~1.5 KB per access (our estimate). A million reads and writes make about 1.5 GB, which fits in the free 50 GiB of most projects. Past it, a million costs about $0.75. Every file counts: a page that shows 20 images from a bucket makes 20 reads.


GCP Pricing References