Google Cloud Platform Projects

All Google Compute Engine resources belong to a Google Cloud Platform project. Projects form the basis for enabling and using the Google Cloud Platform services, including managing APIs, enabling billing, adding and removing collaborators and enabling other Google services. Each project is a separate compartment and each resource belongs to exactly one such compartment. Projects can have different owners and users, are billed separately, and are managed separately.

After Google Compute Engine is enabled, any resources you create or use in Google Compute Engine belong to the project. Projects have some settings that apply broadly to resources contained in that project. For example, project-wide metadata applies to all virtual machine instances within a project. It is possible to have many projects with Google Compute Engine enabled. To differentiate between them, Google Compute Engine requires that you always identify the project you're working in when interacting with the Google Compute Engine service.


Managing projects

You can create and manage projects in the Google Cloud Platform Console. For instructions, see the Cloud Platform Console documentation.

Identifying projects

In order to interact with Google Compute Engine resources, you must provide identifying project information for every request. If you are using gcloud compute, you can save your project ID so it is automatically provided, but in the API, you must always identify the target project with each request.

A project can be identified two ways: using a project ID, or a project number. A project ID is the customized name you chose when you created the project, or when you activated an API that required you to create a project ID. A project number is automatically generated by the server. Both the project ID and project number can be found on the Dashboard of the project:

Both the project number and project ID are unique across Google Cloud Platform. If another user owns a project ID for their project, you won't be able to use the same project ID.

Note that a project ID is different than a project name. The project name is a human-readable way to identify your projects, but it is not used by any Google APIs. In this example, the project name is Example and the project ID is example-project-a.

In gcloud, you can set a default project ID so that it is automatically provided for each request. To set a default project ID, use the gcloud config set command:

gcloud config set project example-project-a

When you choose your project ID (or any resource names), avoid providing sensitive information in your names.

Project team members

You can add users to your project as project team members. Project team members can collaborate on and access the project to varying degrees, depending on the level of access you grant them.

For more information, read about access control.

Getting project information

To get basic information about a project such as the project ID, project name, and project number, go to the Google Cloud Platform Console. Project information can be found on the Dashboard of the Cloud Platform Console.

The Compute Engine API allows you to fetch other project information as well. For example, you can also use the API or gcloud compute project-info describe to get the following information:

  • Project quotas
  • Project ID, returned in the name field
  • Any custom metadata for the project

gcloud and the API does not return the following information:

  • The project number
  • Project name ("My great project")
gcloud [--project PROJECT_ID] compute project-info describe
  fingerprint: 6GCr7A6I_3Y=
  - key: custom-metadata
    value: '1234'
  - key: ssh-keys
    value: 'user:ssh-rsa AAAAB3NzaC1yc2EA...'
  kind: compute#metadata
creationTimestamp: '2013-09-06T10:36:53.505-07:00'
description: ''
id: '574734885120952459'
kind: compute#project
name: myproject
- limit: 1000.0
  metric: SNAPSHOTS
  usage: 0.0
- limit: 5.0
  metric: NETWORKS
  usage: 1.0
- limit: 100.0
  metric: FIREWALLS
  usage: 7.0

Default region and zone

Currently, when you create a new project, Compute Engine automatically selects a default region and zone for the project, based on the location from where the project was created. Compute Engine makes a reasonable attempt to pick a region and zone that is the closest to where the project originated, so that resources you create will, ideally, have reduced latency to your customers or clients.

Compute Engine sets the default region and zone by setting two values in the project's metadata server. The metadata server contains metadata information about the project, including the project ID, project name, and so on. You can query the metadata server to get and use information about the project.

In the metadata server, the following two metadata values are set by default:

  • google-compute-default-zone
  • google-compute-default-region

To see what your default region and zone settings are, run the following gcloud command, replacing PROJECT_ID with the project that you want to get the information about. If you omit the project ID, gcloud will use your default project.

gcloud compute project-info describe --project PROJECT_ID

Look for the default zone and region metadata values in the response.

How a default region and zone affects you

The default region and zone settings affect only client tools gcloud and the Google Cloud Platform Console. Both of these tools use the default zone and region information to help you manage resources more easily by automatically pre-selecting the zone and region when you construct your requests.

In the Cloud Platform Console, zone and region fields are pre-populated when you create zonal or regional resources like instances and addresses. You can simply accept the pre-populated values, or explicitly change the value.

In gcloud, you can omit the --zone and --region flags and gcloud uses the default zone and region properties for the project.

You can always change your default region and zone in the metadata server, override the default zone and region locally for gcloud, or override it manually for each request in both gcloud and the Google Cloud Platform Console.

Changing a default region or zone

To change a default region or zone in the metadata server in gcloud, read Change your default zone and region in the metadata server in the gcloud documentation.

To change your default zone or region in the Cloud Platform Console:

  1. Go to the Metadata pane in the Cloud Platform Console.
  2. Click the Edit button and update the default zone and region values.

Send feedback about...

Compute Engine Documentation