पाठ 2 / 25

Organization, Folders, Projects and Billing

Place resources in the resource hierarchy and link them to billing.

Projects are the basic container

Every Google Cloud resource belongs to a project. A project has a human-friendly name, a globally unique, permanent project ID (used in commands and APIs) and a project number. Projects are where you enable APIs, set quotas and attach a billing account. Above projects, a company's organization node (tied to its Google Workspace or Cloud Identity domain) holds folders, which usually mirror departments or environments (prod, non-prod). IAM policies and organization policies set at a higher level are inherited by everything below, so granting a role on a folder grants it in every project inside. Labels (key-value pairs like env=dev, team=payments) go on resources and flow into billing exports for cost reports. Shutting down a project deletes its resources after a short recovery window, which makes per-environment projects easy to clean up.

Creating a project and linking billing

Project IDs cannot be changed later, so choose a naming convention first.

gcloud projects create shop-dev-123456 --name="Shop Dev" --folder=123456789012 \
  --labels=env=dev,team=shop

gcloud billing accounts list
gcloud billing projects link shop-dev-123456 --billing-account=0X0X0X-0X0X0X-0X0X0X

# APIs are off until you enable them
gcloud services enable run.googleapis.com artifactregistry.googleapis.com \
  --project=shop-dev-123456

A company with departments and project files

The organization is the company, folders are departments, projects are individual project files with their own budget code, and labels are coloured stickers that let accounts sort the bills.

त्वरित जाँच: Where do you enable an API such as Cloud Run and attach a billing account?

  • On a label
  • On a zone
  • On a VPC subnet
  • On the project
Answer

On the project — Projects are the unit for enabled APIs, quotas and billing linkage.