You can use search-all-resources to search all the resources across services (or APIs) and projects for a given organization, folder, or project.
To search all the resources in a project with number 123:
$ gcloud asset search-all-resources --scope=projects/123
To limit to only compute resources:
$ gcloud asset search-all-resources --scope=projects/123 --query="compute.googleapis.com"
To limit to only resources containing "foo" as a sub string:
$ gcloud asset search-all-resources --scope=projects/123 --query="*foo*"
To list all the projects within an organization 456:
$ gcloud asset search-all-resources --scope=organizations/456 --asset-types=cloudresourcemanager.googleapis.com/Project
To find all the BigQuery datasets containing "foo" as a sub string within an organization 456:
$ gcloud asset search-all-resources --scope=organizations/456 --query="bigquery datasets *foo*"
You can set the scope to a project, a folder or an organization.
To use the command, you must:
Enable Cloud Asset API, and
Have cloudasset.assets.searchAllResources
permission upon the scope, which is included in these roles:
- roles/cloudasset.viewer
- roles/cloudasset.owner
- roles/viewer
- roles/editor
- roles/owner
Documentation: