Skip to content
Tutorials Center
My learning

Topics

Lesson 5 of 45 ยท Getting Started

Projects and the Resource Hierarchy

Learn how Google Cloud organizes resources: organization, folders and projects, project ID vs number, labels, tags and quotas, with an inheritance resolver.

Everything you create in Google Cloud (a VM, a bucket, a database) belongs to a project. A project is the basic container for resources, permissions, APIs and billing. Above projects sits an optional tree of folders and an organization, which let companies manage thousands of projects with shared rules.

Understanding this hierarchy early saves pain later, because permissions and policies flow down it. If you grant someone access at the top, they get it everywhere below. This lesson explains each level, the three names of a project, labels and tags, quotas, and ends with a program that resolves inherited settings through a tree.

The hierarchy

Four levels, top to bottom

Organization The root node for a company domain.
Folders Group projects by team or environment.
Projects Where resources actually live.
Resources VMs, buckets, databases and more.

Policies and IAM roles flow downward.

1 / 2
  • The organization exists when you use Google Workspace or Cloud Identity with a domain. A hobbyist with a personal Gmail account usually has no organization, only projects.
  • Folders are optional. Typical layouts group by department (finance, engineering) or by environment (production, staging, sandbox).
  • A project holds resources and is linked to one billing account (Account, Free Tier and Billing Setup).
flowchart TD
  O["Organization<br/>example.com"] --> F1["Folder: engineering"]
  O --> F2["Folder: finance"]
  F1 --> P1["Project: shop-prod"]
  F1 --> P2["Project: shop-dev"]
  F2 --> P3["Project: reports"]
  P1 --> R["Resources: VMs, buckets, databases"]

Access granted on a node applies to everything beneath it.

Why projects matter

A project is a boundary for:

  • Permissions: you can give a teammate access to shop-dev without touching shop-prod.
  • Billing and reporting: costs are reported per project, which makes it easy to see what each app or team spends.
  • APIs: each service (such as Compute Engine or BigQuery) must be enabled per project.
  • Quotas: limits apply per project, discussed below.
  • Cleanup: deleting a project removes everything inside. It enters a pending-deletion period of about 30 days during which it can be recovered.

A common pattern is one project per application per environment, for example shop-dev, shop-staging and shop-prod. It limits the damage of mistakes, since a test cannot accidentally touch production data.

Three names for one project

Every project has three identifiers, and mixing them up causes errors.

Name Example Rules
Display name My Shop (dev) Human-friendly, can be changed
Project ID shop-dev-481516 Globally unique, chosen at creation, cannot be changed
Project number 123456789012 Assigned by Google, never changes

Use the project ID in gcloud commands and Terraform; the number appears inside some service-account names and policies. The ID becomes part of many resource names and URLs, so choose it carefully and avoid putting secrets or personal data in it, as it can be visible.

Terminal
# Create a project and make it the default for later commands (needs a real account)
gcloud projects create shop-dev-481516 --name="My Shop (dev)"
gcloud config set project shop-dev-481516
gcloud projects describe shop-dev-481516

Labels and tags

Two features add metadata, and they do different jobs.

  • Labels are key-value pairs such as env=prod or team=payments that you attach to resources. They show up in billing exports, so you can answer "how much does the payments team spend?" (Cost Management and Optimization). Labels are for organizing and reporting; they do not grant or deny access.
  • Tags are a separate, governed feature: tag keys and values are defined centrally, attached to resources, and can be used by policies, such as conditional IAM grants or firewall rules.

A beginner's rule: use labels for cost and inventory, tags when a policy should react.

Quotas and limits

Each project has quotas: caps on how much of a resource it can use, for example the number of CPUs in a region or API requests per minute. Quotas protect you and Google from accidents, such as a loop creating a thousand VMs. New projects start with modest quotas, and you can request an increase in the console. When you exceed one you see an error mentioning quota; see Common Mistakes and Troubleshooting. Quotas are different from budgets: a quota limits quantity, a budget only sends alerts about money.

Inheritance in practice

IAM allow policies (IAM: Principals, Roles and Policies) and organization policies are inherited. If you give a group Viewer on the folder engineering, its members can view everything in every project inside that folder. This is powerful and risky: grant at the lowest level that works. Organization policies can also restrict (for example, disallow external IP addresses), and a child can usually only add to or adjust what a parent sets within the rules of that constraint.

A stand-in inheritance resolver

The code below models the tree and answers a question that Google's systems answer for you: "what is the effective setting for this project?" Here each node may define simple key-value settings, and a child inherits from the closest ancestor that sets a value. This is a teaching model. Real IAM bindings are additive (a project's access is the union of the grants along the path), while organization policies have their own merge rules per constraint.

JS Resolve inherited settings

Press Run (or Ctrl + Enter) to see the console output here.

No output.

You can see shop-dev override externalIp while shop-prod keeps the organization default, and reports inherits a region from its folder rather than from the organization.

JS Access is additive down the tree

Press Run (or Ctrl + Enter) to see the console output here.

No output.

The real service evaluates roles into permissions and supports deny policies and conditions; this only shows why a grant high in the tree is visible below it.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which project identifier can never be changed after creation?

    The globally unique project ID is fixed at creation, and the project number never changes either. The display name can be edited.
  2. 2. You grant a group the Viewer role on a folder. Who can see resources in a project inside that folder?

    Allow policies are inherited downward, so the grant applies to every project and resource under the folder.
  3. 3. What are labels mainly used for?

    Labels are free-form key-value metadata that appear in billing data. They do not control access.
  4. 4. Why is one project per environment (dev, staging, prod) a common design?

    Project boundaries keep a test from touching production data and let you give different people different access.

Summary

  • Resources live in projects; folders and an organization sit above them for companies.
  • A project has a display name, a permanent globally unique ID and a project number.
  • Permissions and policies flow down the hierarchy, so grant at the lowest workable level.
  • Labels help cost reporting; tags can drive policies; quotas cap usage per project.
  • One project per app per environment is a safe default, and deleting a project cleans up everything inside.

Next: Console and Cloud Shell