Resource Hierarchy & Inheritance

In Google Cloud, the resource hierarchy is the backbone of how you manage access, organize services, and control billing. It follows a strictly hierarchical structure where policies applied at higher levels are inherited by all child resources.

The “Corporate Building” Analogy: Think of the Organization as the entire skyscraper. Folders are the different floors (Departments like HR, Engineering). Projects are specific rooms on those floors where work happens. Resources (VMs, Buckets) are the furniture and tools inside those rooms. If you have a master key to the floor (Folder), you automatically have access to every room (Project) on that floor.

Core Concepts

1. The Organization Node

The root of the hierarchy. It represents your company and is linked to a Google Workspace or Cloud Identity domain. It provides central visibility and control over all resources in the company.

2. Folders

Folders allow you to group projects and other folders. This is where you map your GCP environment to your organizational structure (e.g., Departmental, Regional, or Environment-based like Prod/Dev).

3. Projects

The base level for enabling APIs, managing billing, and adding services. Every resource must belong to exactly one project. Projects are the “trust boundary” for most services.

4. Resources

The actual services: Compute Engine instances, Cloud Storage buckets, BigQuery datasets, etc.

Policy Inheritance (The “Why”)

GCP uses a Union policy model. If a user is granted “Storage Admin” at the Folder level and “Compute Admin” at the Project level, their effective permissions on that project are both roles. You cannot “strip away” a permission inherited from a parent using an IAM Allow policy.

Scenario-Based Usage

  • Compliance: Apply a “Deny” policy at the Org level to prevent any project from creating external IP addresses.
  • Billing: Link multiple projects to a single Billing Account, but group them under folders to track costs by department.
  • Mergers: Move an entire folder from one Org to another (requires specific Resource Manager permissions).
Feature Google Cloud (GCP) AWS Equivalent
Root Container Organization AWS Organizations (Root)
Grouping Mechanism Folders Organizational Units (OUs)
Resource Container Project AWS Account
Service Policies Organization Policy Service Service Control Policies (SCPs)
Golden Nuggets & Gotchas
  • The “Union” Rule: IAM permissions are additive. You cannot revoke a permission at a child level if it was granted at a parent level.
  • Project Deletion: When you delete a project, it enters a 30-day “soft delete” state before permanent removal.
  • Folder Nesting: Folders can be nested up to 10 levels deep (but 3-4 is usually the architectural sweet spot).
  • Organization Policy vs. IAM: IAM defines who can do what. Organization Policies define what can be done with a resource (e.g., restricting locations).

Common Interview Questions

1. If a user has ‘Viewer’ at the Org level but ‘Editor’ at the Project level, what is their effective permission?
They are an Editor. Permissions are the union of all policies.
2. How do you prevent developers from creating expensive resources across the entire company?
Use Organization Policies to restrict specific resource types or VM machine types at the Org or Folder level.
3. Can a project exist without an Organization node?
Yes (as a “No Organization” project), but this is not recommended for enterprises as it lacks central management.
4. What is the limit for folder nesting?
10 levels.
5. A project is deleted by mistake. How long do you have to recover it?
30 days.

Visualizing GCP Resource Hierarchy

Organization Node Folder: Production Folder: Development Project: ERP-Prod Project: ERP-Dev GCE VM GCS Bucket

Flow: Policies flow DOWN. Visibility flows UP.

Service Ecosystem

IAM: Role assignments at any level inherit downwards.

Cloud Billing: Linked at the Project level, but can be managed at Org level.

Resource Manager API: The engine that handles moves, deletes, and tags.

Performance & Scaling

Quotas: Most quotas are enforced at the Project level.

Limits: 10 levels of folders; 30 projects per Org by default (adjustable via request).

Speed: Hierarchy changes (IAM) propagate in seconds.

Cost Optimization

Billing Export: Always export billing data to BigQuery at the Billing Account level.

Labels vs Tags: Use Labels for cost filtering and Tags for conditional IAM/Org policies.

Production Use Case: Multi-Tenant SaaS

A SaaS provider uses Folders for each client. Each client folder contains a Project for “Data Ingestion” and “Reporting.” By applying IAM roles at the Client Folder level, the provider ensures client isolation while maintaining global admin access from the Organization level.

Pros: Extreme isolation, clear billing. Cons: Managing many projects requires automation (Terraform).

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top