Skip to content

🏒 Resource Hierarchy

Google Cloud uses a hierarchical structure to organize and manage resources, providing centralized control over access, billing, and policies.

Hierarchy Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Resource Hierarchy                        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚  Organization    β”‚  ← Root node (company.com)
                    β”‚  (Root Node)     β”‚
                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                             β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚              β”‚              β”‚
        β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”
        β”‚  Folder   β”‚  β”‚ Folder  β”‚  β”‚  Folder   β”‚  ← Departments/Teams
        β”‚  (Prod)   β”‚  β”‚  (Dev)  β”‚  β”‚  (Shared) β”‚
        β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
              β”‚             β”‚              β”‚
        β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”
        β”‚  Project  β”‚  β”‚Project β”‚   β”‚ Project  β”‚  ← Billing & isolation
        β”‚  (App-1)  β”‚  β”‚(App-2) β”‚   β”‚(Network) β”‚
        β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”¬β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
              β”‚            β”‚              β”‚
        β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”  β”Œβ”€β”€β–Όβ”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
        β”‚ Resources β”‚  β”‚Resourcesβ”‚  β”‚Resources β”‚  ← VMs, DBs, etc.
        β”‚ β€’ VM      β”‚  β”‚β€’ Cloud  β”‚  β”‚β€’ VPC     β”‚
        β”‚ β€’ DB      β”‚  β”‚  Run    β”‚  β”‚β€’ Firewallβ”‚
        β”‚ β€’ Bucket  β”‚  β”‚β€’ Storageβ”‚  β”‚β€’ Routes  β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

1. Organization Node

The Organization is the root node representing your company or domain.

Key Characteristics

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Organization: company.com                             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                         β”‚
β”‚  Purpose:                                              β”‚
β”‚    β€’ Top-level container for all GCP resources        β”‚
β”‚    β€’ Centralized policy management                     β”‚
β”‚    β€’ Organization-wide IAM roles                       β”‚
β”‚    β€’ Consolidated billing                              β”‚
β”‚                                                         β”‚
β”‚  Created when:                                         β”‚
β”‚    β€’ Google Workspace account exists                   β”‚
β”‚    β€’ Cloud Identity account is set up                  β”‚
β”‚                                                         β”‚
β”‚  Organization Admin:                                   β”‚
β”‚    β€’ Full control over all resources                   β”‚
β”‚    β€’ Can grant/revoke access                           β”‚
β”‚    β€’ Manages organization policies                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Organization Roles

Role Permissions Use Case
Organization Admin Full control over organization IT administrators
Organization Viewer Read-only access to organization Auditors, compliance
Folder Admin Manage folders and projects Department leads
Project Creator Create new projects Development teams

Setup Organization

# Check if organization exists
gcloud organizations list

# Get organization ID
gcloud organizations describe ORGANIZATION_ID

# Grant organization admin role
gcloud organizations add-iam-policy-binding ORGANIZATION_ID \
  --member='user:admin@company.com' \
  --role='roles/resourcemanager.organizationAdmin'

2. Folders

Folders provide a grouping mechanism for projects, enabling hierarchical organization and policy inheritance.

Folder Structure Patterns

Pattern 1: Environment-Based

Organization (company.com)
   β”‚
   β”œβ”€β”€ Production Folder
   β”‚   β”œβ”€β”€ ecommerce-prod
   β”‚   β”œβ”€β”€ analytics-prod
   β”‚   └── api-gateway-prod
   β”‚
   β”œβ”€β”€ Staging Folder
   β”‚   β”œβ”€β”€ ecommerce-staging
   β”‚   └── analytics-staging
   β”‚
   β”œβ”€β”€ Development Folder
   β”‚   β”œβ”€β”€ ecommerce-dev
   β”‚   └── analytics-dev
   β”‚
   └── Sandbox Folder
       └── experimental-projects

Pattern 2: Department-Based

Organization (company.com)
   β”‚
   β”œβ”€β”€ Engineering Folder
   β”‚   β”œβ”€β”€ Backend Team
   β”‚   β”‚   β”œβ”€β”€ api-services-prod
   β”‚   β”‚   └── api-services-dev
   β”‚   └── Frontend Team
   β”‚       β”œβ”€β”€ web-app-prod
   β”‚       └── web-app-dev
   β”‚
   β”œβ”€β”€ Data Science Folder
   β”‚   β”œβ”€β”€ ml-models-prod
   β”‚   └── data-pipelines
   β”‚
   β”œβ”€β”€ Security Folder
   β”‚   β”œβ”€β”€ security-monitoring
   β”‚   └── compliance-logs
   β”‚
   └── Shared Services Folder
       β”œβ”€β”€ networking-hub
       └── monitoring-central

Pattern 3: Business Unit-Based

Organization (company.com)
   β”‚
   β”œβ”€β”€ E-commerce BU
   β”‚   β”œβ”€β”€ Production
   β”‚   β”‚   β”œβ”€β”€ web-frontend
   β”‚   β”‚   β”œβ”€β”€ payment-service
   β”‚   β”‚   └── inventory-service
   β”‚   └── Development
   β”‚       └── dev-projects
   β”‚
   β”œβ”€β”€ Analytics BU
   β”‚   β”œβ”€β”€ Data Warehouse
   β”‚   └── BI Tools
   β”‚
   └── Infrastructure BU
       β”œβ”€β”€ Networking
       └── Security

Folder Benefits

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Why Use Folders?                                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                         β”‚
β”‚  1. POLICY INHERITANCE                                 β”‚
β”‚     └─→ Policies applied at folder level cascade      β”‚
β”‚         down to all projects within                    β”‚
β”‚                                                         β”‚
β”‚  2. ACCESS CONTROL                                     β”‚
β”‚     └─→ Grant IAM roles at folder level for           β”‚
β”‚         multiple projects at once                      β”‚
β”‚                                                         β”‚
β”‚  3. ORGANIZATION                                       β”‚
β”‚     └─→ Logical grouping by environment, team,        β”‚
β”‚         or business unit                               β”‚
β”‚                                                         β”‚
β”‚  4. BILLING SEPARATION                                 β”‚
β”‚     └─→ Track costs by folder/department              β”‚
β”‚                                                         β”‚
β”‚  5. COMPLIANCE                                         β”‚
β”‚     └─→ Enforce security policies per environment     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Folder Management

# Create folder
gcloud resource-manager folders create \
  --display-name="Production" \
  --organization=ORGANIZATION_ID

# List folders
gcloud resource-manager folders list \
  --organization=ORGANIZATION_ID

# Move project to folder
gcloud projects move PROJECT_ID \
  --folder=FOLDER_ID

# Set IAM policy on folder
gcloud resource-manager folders add-iam-policy-binding FOLDER_ID \
  --member='group:engineering@company.com' \
  --role='roles/editor'

3. Projects

Projects are the core organizational unit in GCP. All resources must belong to a project.

Project Characteristics

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Project: ecommerce-prod-2026                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                         β”‚
β”‚  Project ID:      ecommerce-prod-2026                  β”‚
β”‚  Project Number:  123456789012                         β”‚
β”‚  Project Name:    E-commerce Production                β”‚
β”‚                                                         β”‚
β”‚  Purpose:                                              β”‚
β”‚    β€’ Billing boundary (separate billing account)       β”‚
β”‚    β€’ Resource namespace (unique resource names)        β”‚
β”‚    β€’ IAM boundary (access control isolation)           β”‚
β”‚    β€’ API enablement (enable services per project)      β”‚
β”‚    β€’ Quota management (resource limits per project)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Project Naming Conventions

Pattern: <service>-<environment>-<region>-<purpose>

Examples:
  βœ“ ecommerce-prod-us-web
  βœ“ analytics-dev-eu-pipeline
  βœ“ payment-staging-asia-api
  βœ“ shared-prod-global-network
  βœ“ ml-training-dev-us-gpu

Best Practices:
  β€’ Use lowercase and hyphens
  β€’ Include environment (prod/staging/dev)
  β€’ Keep it descriptive but concise
  β€’ Project ID is immutable (choose carefully)

Project Structure Example

Project: ecommerce-prod-us
β”œβ”€β”€ Compute Resources
β”‚   β”œβ”€β”€ GKE Cluster (web-cluster)
β”‚   β”œβ”€β”€ Compute Engine VMs (batch-processors)
β”‚   └── Cloud Run Services (api-gateway)
β”‚
β”œβ”€β”€ Storage Resources
β”‚   β”œβ”€β”€ Cloud Storage Buckets (product-images)
β”‚   β”œβ”€β”€ Persistent Disks (database-volumes)
β”‚   └── Filestore (shared-files)
β”‚
β”œβ”€β”€ Database Resources
β”‚   β”œβ”€β”€ Cloud SQL (postgres-primary)
β”‚   β”œβ”€β”€ Cloud Spanner (global-inventory)
β”‚   └── Firestore (user-sessions)
β”‚
β”œβ”€β”€ Networking Resources
β”‚   β”œβ”€β”€ VPC Network (prod-vpc)
β”‚   β”œβ”€β”€ Subnets (web-subnet, db-subnet)
β”‚   β”œβ”€β”€ Firewall Rules (allow-http, allow-ssh)
β”‚   └── Load Balancers (global-lb)
β”‚
└── Security & Monitoring
    β”œβ”€β”€ IAM Policies
    β”œβ”€β”€ Service Accounts
    β”œβ”€β”€ Cloud Monitoring
    └── Cloud Logging

Project Management

# Create project
gcloud projects create ecommerce-prod-2026 \
  --name="E-commerce Production" \
  --folder=FOLDER_ID

# List projects
gcloud projects list

# Set active project
gcloud config set project ecommerce-prod-2026

# Enable APIs
gcloud services enable compute.googleapis.com
gcloud services enable container.googleapis.com
gcloud services enable sqladmin.googleapis.com

# Get project details
gcloud projects describe ecommerce-prod-2026

# Delete project (soft delete, 30-day recovery)
gcloud projects delete ecommerce-prod-2026

4. Resources

Resources are the actual GCP services and components that run within projects.

Resource Categories

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Resource Types in GCP                                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                         β”‚
β”‚  COMPUTE                                               β”‚
β”‚    β€’ Compute Engine VMs                                β”‚
β”‚    β€’ GKE Clusters & Nodes                              β”‚
β”‚    β€’ Cloud Run Services                                β”‚
β”‚    β€’ App Engine Applications                           β”‚
β”‚    β€’ Cloud Functions                                   β”‚
β”‚                                                         β”‚
β”‚  STORAGE                                               β”‚
β”‚    β€’ Cloud Storage Buckets                             β”‚
β”‚    β€’ Persistent Disks                                  β”‚
β”‚    β€’ Filestore Instances                               β”‚
β”‚                                                         β”‚
β”‚  DATABASES                                             β”‚
β”‚    β€’ Cloud SQL Instances                               β”‚
β”‚    β€’ Cloud Spanner Databases                           β”‚
β”‚    β€’ Firestore Databases                               β”‚
β”‚    β€’ Bigtable Instances                                β”‚
β”‚                                                         β”‚
β”‚  NETWORKING                                            β”‚
β”‚    β€’ VPC Networks                                      β”‚
β”‚    β€’ Subnets                                           β”‚
β”‚    β€’ Firewall Rules                                    β”‚
β”‚    β€’ Load Balancers                                    β”‚
β”‚    β€’ Cloud NAT                                         β”‚
β”‚                                                         β”‚
β”‚  SECURITY                                              β”‚
β”‚    β€’ Service Accounts                                  β”‚
β”‚    β€’ IAM Policies                                      β”‚
β”‚    β€’ Secrets (Secret Manager)                          β”‚
β”‚    β€’ Encryption Keys (Cloud KMS)                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Resource Scope

Scope Description Examples
Global Available across all regions VPC networks, Global load balancers, IAM
Regional Specific to a region Cloud SQL, GKE clusters, Regional disks
Zonal Specific to a zone Compute Engine VMs, Zonal disks, GKE nodes

Policy Inheritance

Policies and IAM permissions flow down the hierarchy.

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Policy Inheritance Flow                               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Organization Level
β”œβ”€ Policy: Require MFA for all users
β”‚  └─→ Applies to ALL folders and projects
β”‚
Folder Level (Production)
β”œβ”€ Policy: Restrict VM creation to specific machine types
β”‚  └─→ Applies to ALL projects in Production folder
β”‚
Project Level (ecommerce-prod)
β”œβ”€ Policy: Enable VPC Flow Logs
β”‚  └─→ Applies to ALL resources in this project
β”‚
Resource Level (Compute Engine VM)
└─ Policy: Specific firewall rules
   └─→ Applies to THIS resource only

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Inheritance Rules                                     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  β€’ Child inherits parent policies                     β”‚
β”‚  β€’ Child can add more restrictive policies            β”‚
β”‚  β€’ Child CANNOT override parent policies              β”‚
β”‚  β€’ Policies are cumulative (union of all levels)      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

IAM Inheritance Example

Organization: company.com
β”œβ”€ IAM: alice@company.com β†’ Organization Viewer
β”‚  └─→ Alice can view ALL resources in organization
β”‚
Folder: Production
β”œβ”€ IAM: bob@company.com β†’ Folder Editor
β”‚  └─→ Bob can edit ALL projects in Production folder
β”‚
Project: ecommerce-prod
β”œβ”€ IAM: charlie@company.com β†’ Project Owner
β”‚  └─→ Charlie has full control over ecommerce-prod project
β”‚
Resource: VM Instance
└─ IAM: dave@company.com β†’ Compute Instance Admin
   └─→ Dave can manage THIS specific VM

Effective Permissions:
  β€’ Alice: View all (inherited from org)
  β€’ Bob: Edit all in Production (inherited from folder)
  β€’ Charlie: Full control over ecommerce-prod
  β€’ Dave: Manage specific VM

Real-World Architecture Example

Multi-Environment Setup

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Organization: acme-corp.com                               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚                   β”‚                   β”‚
   β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”       β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”
   β”‚Productionβ”‚       β”‚ Staging  β”‚       β”‚   Dev    β”‚
   β”‚  Folder  β”‚       β”‚  Folder  β”‚       β”‚  Folder  β”‚
   β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜       β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
        β”‚                  β”‚                   β”‚
   β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ web-prod-us   β”‚  β”‚web-staging β”‚    β”‚ web-dev-us   β”‚
   β”‚               β”‚  β”‚            β”‚    β”‚              β”‚
   β”‚ Resources:    β”‚  β”‚Resources:  β”‚    β”‚ Resources:   β”‚
   β”‚ β€’ GKE (n1-std)β”‚  β”‚β€’ GKE (e2)  β”‚    β”‚ β€’ GKE (e2)   β”‚
   β”‚ β€’ Cloud SQL   β”‚  β”‚β€’ Cloud SQL β”‚    β”‚ β€’ Cloud SQL  β”‚
   β”‚   (HA)        β”‚  β”‚  (single)  β”‚    β”‚   (dev)      β”‚
   β”‚ β€’ 10 VMs      β”‚  β”‚β€’ 3 VMs     β”‚    β”‚ β€’ 1 VM       β”‚
   β”‚               β”‚  β”‚            β”‚    β”‚              β”‚
   β”‚ Policies:     β”‚  β”‚Policies:   β”‚    β”‚ Policies:    β”‚
   β”‚ β€’ MFA requiredβ”‚  β”‚β€’ MFA req.  β”‚    β”‚ β€’ Relaxed    β”‚
   β”‚ β€’ Audit logs  β”‚  β”‚β€’ Audit logsβ”‚    β”‚ β€’ No audit   β”‚
   β”‚ β€’ Backup dailyβ”‚  β”‚β€’ Backup    β”‚    β”‚ β€’ No backup  β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚  weekly    β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

IAM Structure:
  Production Folder:
    β€’ SRE Team β†’ Editor
    β€’ Security Team β†’ Viewer
    β€’ Developers β†’ No access

  Staging Folder:
    β€’ SRE Team β†’ Owner
    β€’ Developers β†’ Editor

  Dev Folder:
    β€’ Developers β†’ Owner
    β€’ Everyone β†’ Viewer

Best Practices

1. Hierarchy Design

βœ“ DO:
  β€’ Use folders for logical grouping
  β€’ Separate environments (prod/staging/dev)
  β€’ Apply policies at highest appropriate level
  β€’ Use consistent naming conventions
  β€’ Plan for growth and scalability

βœ— DON'T:
  β€’ Create flat structure (all projects at org level)
  β€’ Mix environments in same folder
  β€’ Grant broad permissions at org level
  β€’ Use generic project names
  β€’ Create too many nested folders (keep it simple)

2. Project Organization

# Good project structure
company-prod-us-web
company-prod-us-api
company-prod-us-data
company-staging-us-web
company-dev-us-web

# Bad project structure
project1
project2
test-project
my-project

3. IAM Management

# Grant access at folder level for multiple projects
gcloud resource-manager folders add-iam-policy-binding FOLDER_ID \
  --member='group:developers@company.com' \
  --role='roles/editor'

# Use groups instead of individual users
gcloud projects add-iam-policy-binding PROJECT_ID \
  --member='group:sre-team@company.com' \
  --role='roles/owner'

4. Resource Labeling

# Apply labels for cost tracking and organization
gcloud compute instances create web-vm \
  --labels=environment=production,team=frontend,cost-center=engineering

Migration Strategy

Moving from Flat to Hierarchical Structure

Step 1: Current State (Flat)
Organization
β”œβ”€β”€ project-1
β”œβ”€β”€ project-2
β”œβ”€β”€ project-3
└── project-4

Step 2: Create Folder Structure
Organization
β”œβ”€β”€ Production Folder (created)
β”œβ”€β”€ Staging Folder (created)
└── Development Folder (created)

Step 3: Move Projects
Organization
β”œβ”€β”€ Production Folder
β”‚   β”œβ”€β”€ project-1 (moved)
β”‚   └── project-2 (moved)
β”œβ”€β”€ Staging Folder
β”‚   └── project-3 (moved)
└── Development Folder
    └── project-4 (moved)

Step 4: Apply Policies
Organization
β”œβ”€β”€ Production Folder
β”‚   β”œβ”€β”€ Policy: Require MFA
β”‚   β”œβ”€β”€ Policy: Enable audit logs
β”‚   └── Projects inherit policies