Week 1 – Day 1: GCP Fundamentals & IAM 🎯

Taruniyaa STaruniyaa S
6 min read

πŸ“˜ Day 1: GCP Fundamentals & IAM


πŸ”Ή 1. What is GCP?

GCP (Google Cloud Platform) is Google’s public cloud offering that provides services for:

  • Compute (e.g., VMs, Kubernetes)

  • Storage (e.g., Cloud Storage, Cloud SQL)

  • Networking (e.g., VPC, Load Balancer)

  • AI/ML, Big Data, DevOps tools

βœ… Pay-as-you-go, scalable, reliable, and secure.


πŸ”Ή 2. GCP Global Infrastructure

TermMeaning
RegionA geographical area (e.g., us-central1, asia-south1)
ZoneA deployment area inside a region (e.g., us-central1-a)
Multi-regionServices that replicate data across multiple regions

πŸ“Œ Best Practice: Use multi-zone or multi-region services for high availability.


πŸ”Ή 3. GCP Resource Hierarchy

scssCopyEditOrganization (Optional)
 └── Folder (Optional)
      └── Project (Mandatory)
           └── Resources (VMs, Buckets, etc.)
  • A Project is the main boundary for billing, APIs, permissions, and quotas.

  • Resources must belong to a project.

  • Each project has a Project ID, Project Name, and Project Number.


πŸ”Ή 4. Billing in GCP

  • Billing is linked at the project level.

  • You can set budgets, alerts, and quotas to control costs.

  • Use Billing Reports to track usage.

  • One billing account can be shared across multiple projects.

πŸ”§ Try this later:
Go to Billing β†’ Budgets & alerts and create a budget with 50% and 90% thresholds.


πŸ”Ή 5. Identity & Access Management (IAM)

IAM controls who can do what on which resource.

✳️ IAM Components

ComponentDescription
MemberUser, group, service account, or domain
RoleSet of permissions (e.g., compute.instances.list)
PolicyBinds members to roles on a resource

✳️ IAM Role Types

Role TypeUse Case
PrimitiveOwner, Editor, Viewer (legacy – broad access)
PredefinedGCP-built (e.g., roles/compute.admin)
CustomYou define exactly which permissions are included

βœ… Principle of Least Privilege: Always give minimum required permissions.

🧠 Example:

You want a user to just read storage objects in a bucket:

  • Assign the Storage Object Viewer role: roles/storage.objectViewer

πŸ” Service Accounts

  • Used by applications/VMs, not humans.

  • Acts as an identity for apps to access GCP services securely.

  • Attach a service account to a VM or GKE pod to grant it access to APIs (like writing to Cloud Storage).


πŸ§ͺ Practice/Review Questions

  1. What is the fundamental boundary for billing and resources in GCP?

    • A. Folder

    • B. Organization

    • βœ… C. Project

    • D. Region

  2. Which IAM role is more secure and specific?

    • A. Owner

    • B. Viewer

    • βœ… C. Predefined role (e.g., Compute Viewer)

    • D. Editor

  3. What's the best way to allow a VM to access Cloud Storage securely?

    • βœ… Use a service account with storage access role

βœ… Summary: Day 1 Key Takeaways

  • Understand the resource hierarchy and billing basics.

  • Projects are the core unit of work.

  • IAM is how access is controlled (Members + Roles + Resources).

  • Always apply the least privilege principle.

  • Service accounts = app identity.

🧠 GCP Day 1 Cheat Sheet: Fundamentals + IAM


🌍 1. GCP Global Infrastructure

βœ… Key Concepts:

TermExampleDescription
Regionus-central1A specific geographical location (e.g., Iowa, USA).
Zoneus-central1-aA deployment area within a region. Each region has multiple zones.
Multi-regionus or asiaLogical location that spans multiple regions. Used for redundancy.

🧠 Why this matters:

  • Deploying across multiple zones = High Availability.

  • Multi-region = Great for services needing global redundancy (e.g., Cloud Storage multi-regional buckets).


πŸ“ 2. GCP Resource Hierarchy

scssCopyEdit(Optional) Organization
 └── (Optional) Folders (for grouping teams/departments)
      └── Project (Required)
           └── Resources (VMs, Buckets, Databases, etc.)

βœ… Key Points:

  • Every resource must be in a project.

  • Projects are the core unit for:

    • Billing

    • API enablement

    • Access control

    • Resource management

  • Each project has:

    • Project ID (unique, unchangeable)

    • Project Name (editable label)

    • Project Number (system-generated)


πŸ’° 3. Billing

  • Billing is tied to projects.

  • You can:

    • Set budgets and alerts

    • Use labels to track costs by team/service

    • Link multiple projects to one billing account

βœ… Tools:

  • Billing Reports: Visualize usage.

  • Budgets & Alerts: Get notified at 50%, 90%, 100% usage.

  • Cost Table Reports: CSV-style data export.


πŸ” 4. Identity and Access Management (IAM)

IAM = Who can do What on Which resource

🎯 Components:

ComponentDescription
MemberA user (abc@gmail.com), group, domain, or service account
RoleA collection of permissions (e.g., compute.instances.start)
PolicyA set of role bindings (i.e., member-role-resource links)

πŸ”‘ Role Types

TypeDescriptionExample
PrimitiveBroad, legacy rolesViewer, Editor, Owner
PredefinedGoogle-created, fine-grainedroles/compute.viewer, roles/storage.admin
CustomUser-definedSpecific to org needs (e.g., read-only logs access)

βœ… Always prefer Predefined roles unless your use case is highly specific.


βš™οΈ How IAM Works

Policy Structure:

jsonCopyEdit{
 "bindings": [
   {
     "role": "roles/storage.admin",
     "members": [
       "user:john@example.com"
     ]
   }
 ]
}
  • Policies are attached to resources (project, bucket, VM).

  • Permissions flow down the hierarchy:

    • If a user has roles/storage.admin on the project, they can manage all buckets inside.

πŸ€– 5. Service Accounts (SA)

Used for apps/scripts/services to interact with GCP securely.

  • A non-human identity.

  • Has IAM roles just like users.

  • Can be attached to:

    • VMs

    • GKE pods

    • Cloud Functions

  • GCP uses OAuth tokens or signed keys for SA auth.


πŸ“Œ Best Practices Summary

PrincipleBest Practice
Least PrivilegeGive minimum access needed, no broad Editor role.
Use Service AccountsFor app-to-GCP access. Never share user credentials.
Use Predefined RolesSafer and clearer than primitive roles.
Organize with FoldersHelpful in large orgs to group related projects.

βœ… Quick Quiz for You

  1. What’s the smallest deployable unit in GCP?

    • βœ… Project (everything is created inside it)
  2. Can you create a resource (e.g., VM) without a project?

    • ❌ No – Every resource needs a project.
  3. How do you grant a VM access to Cloud Storage?

    • βœ… Create a Service Account, assign roles/storage.objectViewer and attach to VM.
0
Subscribe to my newsletter

Read articles from Taruniyaa S directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Taruniyaa S
Taruniyaa S