Create project, region and zone

Google cloud manages resources using projects, regions and zones. Projects are simple containers for artifacts. Regions represent geographic areas, with zones representing a finer area with a region.

  1. Login to the Google Cloud Portal at cloud.google.com.
  2. Click Console.
  3. In the Console, select the project drop down and choose New Project.
    New project dialog
  4. In the new Project dialog enter a Project name.
    Optionally select a Location.
  5. Click Create.
    The new project creation may take several minutes.
  6. Once complete select the newly created project from the project list dropdown.

 

  1. Login to the Google Cloud
    gcloud auth login
    A browser page will open, enter appropriate credentials and login to the Google Cloud:
  2. Create a new project using gcloud project create projectName.
    For example:
    gcloud projects create accessgateway
    Which will produce results similar to:
    Create in progress for [https://cloudresourcemanager.googleapis.com/v1/projects/accessgateway].
    Waiting for [operations/cp.6360392293679086985] to finish...done.
    Enabling service [cloudapis.googleapis.com] on project [accessgateway]...
    Operation "operations/acf.2e54ecd8-a4ed-4935-9de9-d367b5996552" finished successfully.
  3. Set the project as the default project using gcloud config set project projectName.
    For example
    gcloud config set project accessgateway
    Which will return a result similar to:
    Updated property [core/project]
  4. List all known zones and regions using the gcloud compute zones list command.
    For example:
    gcloud compute zones list
    Which will produce output similar to:
    NAME          REGION       STATUS  . . . 
    us-east1-b    us-east1     UP
    us-east1-c    us-east1     UP
    us-east1-d    us-east1     UP
    us-east4-c    us-east4     UP 
    . . . 
    
  5. Specify a default region and zone using the command
    cloud compute project-info add-metadata \
    -metadata google-compute-default-region=<region>,google-compute-default-zone=<zone>
    Where:
    • <region> is one of the regions from the regions list
    • <zone> is one of the zones within the region
    For example:
    gcloud compute project-info add-metadata \
    --metadata google-compute-default-region=useast1,google-compute-default-zone=useast1-b
    Which should produce results similar to:
    Updated [https://www.googleapis.com/compute/v1/projects/accessgateway].
  6. Info

    Note

    You can set a default zone and region using the following commands.
    gcloud config set compute/region <region> and gcloud config set compute/zone <zone>

Reference