Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using the Google Cloud Platform SDK CLI to List all Active Resources Under a Given Project

Tags:

Is it possible to list, through the Google Cloud Platform (GCP) SDK CLI (gcloud), all active resources under a given GCP project?

like image 979
bsam Avatar asked Sep 25 '19 16:09

bsam


People also ask

Which command is used to display the project information from CLI in GCP?

gcloud config set project : Set a default Google Cloud project to work on. gcloud info : Display current gcloud CLI environment details.

What is the available CLI utility in GCP to perform actions?

What is the gcloud CLI? The Google Cloud CLI is a set of tools to create and manage Google Cloud resources. You can use these tools to perform many common platform tasks from the command line or through scripts and other automation.


1 Answers

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

See the other post for more details: How to find, list, or search resources across services (APIs) and projects in Google Cloud Platform?

like image 51
Circy Avatar answered Oct 04 '22 09:10

Circy