Skip to main content
selectGooglelast verified 2026-07-31
Servicescompute
CredentialsGOOGLE_CREDENTIALS
Permissionscompute.instances.list
Fan-out: project - one call per project when swept org-wide. One aggregated call per project when swept org-wide

GCE instances in a project

Lists Compute Engine instances across every zone in a project. Supplying only the project routes to the aggregated list, which covers all zones in a single request - far cheaper than iterating zones, and it avoids missing instances in zones you did not think to check.

Query

SELECT name, status, machineType, zone, creationTimestamp
FROM google.compute.instances
WHERE project = '{{project}}';

Variation: a single zone

Adding zone routes to the per-zone list instead:

SELECT name, status, machineType, zone, creationTimestamp
FROM google.compute.instances
WHERE project = '{{project}}'
AND zone = 'us-central1-a';

Notes

Project alone routes to aggregated_list and zone narrows it to the per-zone list - two different operations on one resource, so the aggregated form is the one to reach for unless a specific zone is genuinely the question. The per-zone form has a reporting quirk worth knowing: a zone with no instances returns a single row whose columns are all null except the zone that was requested, rather than zero rows, so test a data column such as name for null rather than counting rows. machineType and zone come back as full resource URLs - take the last path segment for the short name. TERMINATED in GCE means stopped rather than deleted, and stopped instances still appear here and still bill for attached disks, so filter on status when counting live capacity.

Related queries

  • GCP projects under an org or folder - Lists projects directly under a parent organization or folder with state, display name and labels; the fan-out dimension for any org-wide GCP audit.
  • GCP service accounts in a project - Lists IAM service accounts in one project with email, display name and unique id; the workload principal inventory for a privilege audit.