How to determine the project associated with a cloud storage bucket?

+1 vote
I am working on multiple projects on GCP and also have created a number of cloud storage buckets. I don't remember which project I created a bucket in. How can I find it?
Nov 18, 2019 in GCP by anonymous
• 8,200 points
71 views

1 answer to this question.

+1 vote

To find which project contains a specific bucket:

  • If you are searching over a moderate number of projects and buckets, use the Google Cloud Console, select each project, and view the buckets it contains.

  • Otherwise, go to the storage.bucket.get page in the API Explorer and enter the bucket's name in the bucket field. When you click Authorize and Execute, the associated project number appears as part of the response. To get the project name, use the project number in the following terminal command:

    gcloud projects list | grep [PROJECT_NUMBER]
answered Nov 18, 2019 by Sirajul
• 45,960 points

I found this answer very helpful.

But it took me a while to figure out how to use the API Explorer and to find the right page within the API Explorer. It's the "Cloud Storage JSON API".

Also, I was able to get the same information using

gsutil ls -L -b gs://bucket | grep projectNumber

Related Questions In GCP

0 votes
1 answer

How to export a custom image to the cloud storage?

The preferred way to export an image ...READ MORE

answered Oct 18, 2019 in GCP by Sirajul
• 45,960 points
115 views
0 votes
1 answer

How to create a cloud storage bucket in GCP?

Buckets are the basic containers that hold your ...READ MORE

answered Oct 23, 2019 in GCP by Sirajul
• 45,960 points
48 views
0 votes
1 answer

How to change the storage class of objects within a bucket?

You could do this probably by overwriting the ...READ MORE

answered Oct 24, 2019 in GCP by Sirajul
• 45,960 points
34 views
0 votes
1 answer

GCP Error: 403: Access Denied

Check that your credentials are correct. For ...READ MORE

answered Oct 9, 2019 in GCP by Sirajul
• 45,960 points
61 views
0 votes
1 answer

Permissions issue with Google Cloud Storage Bucket.

You can regain access to the object by assigning an applicable role, like roles/storage.objectAdmin, to ...READ MORE

answered Oct 10, 2019 in GCP by Sirajul
• 45,960 points
214 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer