Skip to main content
selectGooglelast verified 2026-07-31
Servicesstorage
CredentialsGOOGLE_CREDENTIALS
Permissionsstorage.buckets.list
Fan-out: project - one call per project when swept org-wide. One list call per project when swept org-wide

GCS buckets in a project

Lists every Cloud Storage bucket in a single project. Bucket listing is per-project, so an org-wide storage inventory iterates the projects from google/cloudresourcemanager/projects-by-parent and runs this query for each.

Query

SELECT name, location, storageClass, timeCreated
FROM google.storage.buckets
WHERE project = '{{project}}';

Variation: public access and access control posture

iamConfiguration carries the two settings that decide whether a bucket can be made public - uniform bucket-level access, and the public access prevention mode:

SELECT
name,
location,
JSON_EXTRACT(iamConfiguration, '$.uniformBucketLevelAccess.enabled') AS uniform_access,
JSON_EXTRACT(iamConfiguration, '$.publicAccessPrevention') AS public_access_prevention
FROM google.storage.buckets
WHERE project = '{{project}}';

Notes

The parameter is project here, spelled as the project id rather than the projectsId form the IAM API uses - the naming is not consistent across Google services, so check the required params per resource rather than assuming. Bucket names are globally unique across all of GCS, not just the project, which is why a create can fail on a name already taken by another organisation. location is a region such as us-central1 or a multi-region such as US or EU; multi-region buckets replicate across a continent and cost more per GB. Buckets carry no project column in the response, so the project scoping comes entirely from the request parameter - when sweeping several projects, carry the project id through from the loop rather than expecting it in the result.

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.