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
• 19,610 points
10,995 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]

Hope it works!!

To find out more about Google Cloud, join Google Cloud training today.

Thanks!

answered Nov 18, 2019 by Sirajul
• 59,230 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

+1 vote
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
• 59,230 points
1,960 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 24, 2019 in GCP by Sirajul
• 59,230 points
2,183 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 25, 2019 in GCP by Sirajul
• 59,230 points
1,555 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
• 59,230 points
3,641 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
• 59,230 points
4,583 views
0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP