GCP Cloud Cost Optimization — Connect Google Cloud to ZopNight
What does the GCP integration do?
Google Cloud coverage spans 82 rules across 78 resource types, 7 of them schedulable. Committed use discounts, sustained use discounts and per-project quota all behave unlike their AWS equivalents, so the rules read GCP's billing model directly rather than mapping it onto another provider's assumptions.
Coverage by category
ZopNight connects to Google Cloud with a single OAuth consent. It creates its own least-privilege service account in your project, so you never hand over your personal credentials. From there it inventories every billable resource through Cloud Asset Inventory, joins your BigQuery billing export for invoice-accurate costs (credits and committed-use discounts included), and puts your non-production Compute Engine VMs, GKE clusters, Cloud SQL instances and Cloud Run services to sleep on a schedule you control.
One-Click Connect, and where each data type comes from
With One-Click Connect, ZopNight uses your Google sign-in (which must hold Owner or an equivalent set of IAM admin roles) to create the service account zopnight-sa in the target project, enable the required APIs, and bind a documented set of roles that matches your chosen access tier. Prefer manual control? Create the service account yourself and upload its JSON key. Discovery uses a single Cloud Asset Inventory sweep every six hours plus live Vertex AI APIs for freshness; metrics come from Cloud Monitoring with a 42-day lookback; costs come from your BigQuery billing export with 365-day backfill, computed net of credits so they match your invoice.
From Google sign-in to the BigQuery billing export
- Choose Add Cloud Account and select Google Cloud.
- Click One-Click Connect and sign in with an account holding Owner (or the listed admin roles).
- ZopNight creates its service account, enables APIs, and binds roles automatically.
- Enable the BigQuery billing export (Billing > Billing export > BigQuery > Standard usage cost) and paste the table ID (project.dataset.gcp_billing_export_v1_XXXX) into ZopNight.
- (Optional) Have a Workspace admin grant the Groups Reader role to the service account to import Google Groups for team cost attribution. Manual alternative: enable the Cloud Asset API, create a service account with the documented roles, and upload its JSON key.
Discovery breadth, and the 42-day metric window behind it
One-call discovery of ~80 resource types (Compute Engine, GKE, Cloud SQL, Cloud Run, Memorystore, BigQuery, Spanner, Dataproc, Dataflow, the full Vertex AI suite, and more). Invoice-accurate billing from BigQuery export with credits applied. Cloud Monitoring metrics, 42-day lookback, with derived disk IOPS/latency metrics. Scheduling for VMs, GKE node pools/clusters/namespaces, Cloud SQL, Cloud Run, Memorystore and Vertex notebooks. 82 recommendation rules including rightsizing, committed-use discounts, Spot/preemptible adoption, idle Dataproc clusters and GKE bin-packing.
Limits worth knowing before you connect
The Cloud Asset API must be enabled or discovery returns nothing. roles/editor alone is not sufficient for One-Click Connect. Cloud Monitoring retains about six weeks of history, so metric lookback is 42 days.
GCP integration: common questions
I connected GCP and the inventory is empty. What is wrong?
The Cloud Asset API is almost certainly not enabled. Without cloudasset.googleapis.com on the project, discovery returns nothing at all rather than an error, which is the single most common cause of a GCP account that connects cleanly and shows no resources.
Is roles/editor enough for One-Click Connect?
No. One-Click Connect signs in as an account holding Owner, or the listed equivalent set of IAM admin roles, then creates the zopnight-sa service account, enables the APIs and binds the roles itself. If you will not grant that, create the service account manually and upload its JSON key.
Why is the GCP metric lookback only 42 days?
Cloud Monitoring retains about six weeks of history, so 42 days is the window that exists rather than a ZopNight setting. Costs are separate and backfill 365 days from your BigQuery billing export.
Recommendations
82 live rule families evaluate GCP spend. Each page documents the metric, threshold, window, and the IAM actions the check needs.
Scheduling
7 GCP resource types can be stopped and started on a schedule.