We are still cooking the magic in the way!
GCP Fundamentals
GCP Fundamentals
Google Cloud Platform is architected around a resource hierarchy that is meaningfully different from AWS and Azure. Before you touch a single VM or bucket, you need to internalize Organizations, Folders, Projects, and IAM — because getting this wrong at the start causes permission sprawl, audit failures, and billing surprises that are painful to unwind at scale. This lesson gives you the mental model that Google SREs and enterprise customers use on day one.
The GCP Resource Hierarchy
Every GCP resource belongs to exactly one Project. Projects are the fundamental unit of ownership: they carry their own billing account, API enablements, and IAM policies. Above projects sit Folders (optional, but essential at enterprise scale), which group projects into business units or environments. At the root sits the Organization — tied to a Google Workspace or Cloud Identity domain and required for any serious production deployment.
The hierarchy is not just organisational tidiness — it is how IAM inheritance works. A role granted on a Folder propagates down to every Project inside it. A role granted on the Organization propagates to everything. This top-down inheritance is the primary mechanism Google-scale companies use to enforce least-privilege without managing hundreds of individual project policies.
api-prod-8a3f) that can never be changed and is unique across all of GCP. The Project Name is human-readable and mutable. Always derive your Project ID from a pattern like {team}-{env}-{short-hash} — never rely on auto-generated names in IaC.
Setting Up the Hierarchy with gcloud
In practice, Organizations and Folders are provisioned via the Google Cloud Console or Terraform — they require domain verification and the resourcemanager.googleapis.com API. Projects, however, are the daily operational unit and are created frequently. The gcloud CLI is the canonical tool.
google_billing_project_info resource immediately after google_project.
IAM on GCP: How It Differs from AWS and Azure
GCP IAM uses three concepts: Members, Roles, and Bindings. A binding attaches a role to a member on a specific resource. Members can be Google accounts, service accounts, Google Groups, Cloud Identity domains, or the special allUsers / allAuthenticatedUsers principals.
The most important distinction from AWS: GCP has no inline policies. There are only predefined roles (Google-managed), basic roles (Owner/Editor/Viewer — never use in production), and custom roles (fine-grained, org- or project-scoped). Every permission check is additive: deny policies exist but are an advanced feature; the default is allow-by-absence, meaning a principal with no binding has no access.
IAM in Practice: Service Accounts and Workload Identity
In GCP, applications authenticate as Service Accounts — special identities that represent a workload rather than a human. Unlike AWS IAM roles (which are assumed via STS), GCP service accounts are resources: they have their own email address (name@project-id.iam.gserviceaccount.com) and can be granted roles just like any user.
Org-Level Policy Constraints
Beyond IAM, GCP provides Organization Policy constraints — guardrails enforced at the Org or Folder level that override project-level settings. Common production constraints include: disabling public IPs on VMs (compute.vmExternalIpAccess), restricting which regions resources can be created in (gcp.resourceLocations), and requiring OS Login (compute.requireOsLogin). These are enforced even if a project owner tries to bypass them — critical for compliance and cost control at scale.
Production Failure Modes
The most common GCP IAM mistakes seen in production: granting roles/editor to a service account instead of narrowly scoped predefined roles; creating all resources in a single project instead of segregating environments; missing billing account links that cause silent API failures; and relying on service account key files that rotate manually (or never). A well-designed GCP hierarchy with Workload Identity, least-privilege predefined roles, and Org Policy constraints eliminates the majority of these incidents before they reach production.