Create project and set region and zone
Google Cloud Platform manages resources using projects, regions, and zones.
Projects are simple containers for artifacts. Regions represent geographic areas. Zones represent an area within a region.
- Sign in to cloud.google.com.
- Click Console.
- Open the project dropdown list and click NEW PROJECT.
- Enter a name for the project.
- Optional. Select a Location.
- Click CREATE. It can take several minutes to create a project.
- Select the new project from the project dropdown list.
- Sign in to Google Cloud, and enter the appropriate credentials in the browser page that appears:
gcloud auth login
- Run this command to create a project. Replace <project-name> with the name of the project:
gcloud project create <project-name>
- Run this command to set the project as the default project. Replace <project-name> with the name of the project:
gcloud config set project <project-name>
- Run this command to list all known zones and regions:
gcloud compute zones list
- Specify a default region and zone. Replace <region> with the name of the default region from the regions list, and <zone> with the name of the default zone:
cloud compute project-info add-metadata \ -metadata google-compute-default-region=<region>,google-compute-default-zone <zone>
- Run this command to specify a default region for the current account.
Replace <region> with the name of the default region from the regions list:
gcloud config set compute/region <region>
- Run this command to specify a default zone for the current account: Replace
<zone> with the name of the default zone:
gcloud config set compute/zone <zone>
Reference
See Creating and managing projects for more information about using Google Cloud projects.