When should I specify a project on the Google Cloud Platform?

Asked 2 years ago

I want to start using my GCP to run an application so I can be able to reach multiple users across the globe for my business. However, I don’t understand when and why we need to specify a project when performing actions in the cloud storage. Can someone please clarify?

Solomon Macdonald

Sunday, June 12, 2022

Most of the time, you do not need to specify a project when performing actions in Cloud Storage; however, you should include either the project ID or the project number in the following scenarios:

  1. Console: A project is automatically associated with your Cloud Storage account when you use the Google Cloud console. You are also prompted to select a project when you first access a bucket with Requester Pays enabled.
  2. gsutil: Specify a project when you see these commands: Gsutil mb, Gsutil ls (when listing buckets), Gsutil kms (when accessing the authorize and service account subcommands), Gsutil hmac. Use the -p flag with the commands mentioned above when you don't have a defined default project or want to access another different project.
  3. Client Liabraries: When using the Cloud Storage Client Libraries, you need to specify a project under the same criteria as the JSON API.
  4. JASON API: All these methods and techniques need you to specify a project: List buckets, Insert bucket, Get project service agent, all methods related to the HMAC key resource.
  5. XML API: Enlisted below are the requests that require you to specify a project: List buckets, Create a bucket, List HMAC keys, Create, update, or delete an HMAC key.




Write an answer...

Cancel

Please follow our  Community Guidelines

Can't find what you're looking for?