Course contentsShow
← Cloud and Infrastructure
Lesson 392 of 2,9897. Identity and Access ManagementFree lesson

GCP IAM Roles: Basic, Predefined, Custom

Three types of GCP roles with different levels of granularity and use cases.

GCP IAM Roles: Basic, Predefined, Custom

What You'll Learn

You'll understand the three types of IAM roles in Google Cloud Platform and when to use each one.

The Three Flavors of GCP Roles

GCP organizes permissions into three types of roles, each offering different levels of control:

Basic Roles (Primitive Roles)

These are the broadest, legacy roles that apply across your entire project. Think of them as blunt instruments:

  • Owner: Full control (can delete the project itself)
  • Editor: Can modify resources but can't manage access
  • Viewer: Read-only access to everything

Analogy: Like giving someone a master key to your entire building instead of just one room.

⚠️ Warning: Basic roles are too broad for production. They violate the Principle of Least Privilege you learned earlier.

Predefined Roles

Google maintains these roles for specific services with carefully grouped permissions. Examples:

  • roles/storage.objectViewer - Read Cloud Storage objects
  • roles/compute.instanceAdmin.v1 - Manage Compute Engine VMs
  • roles/iam.serviceAccountUser - Act as a service account

Analogy: Like having specialized keys for different departments—accounting, engineering, HR—each with appropriate access.

These are the recommended choice for most use cases because they follow least privilege and are maintained by Google.

Custom Roles

When predefined roles don't fit your exact needs, you can create your own by bundling specific permissions:

roles/myCompany.customDeveloper
  - compute.instances.get
  - compute.instances.list
  - storage.objects.get

Use these sparingly—they require manual maintenance as GCP evolves.

When to Use Each

  • Basic: Almost never in production (testing only)
  • Predefined: Your default choice (90%+ of cases)
  • Custom: Only when predefined roles are too broad or too narrow

Key Takeaway: GCP offers Basic roles (too broad), Predefined roles (recommended), and Custom roles (for special cases)—always prefer predefined roles to maintain security and reduce maintenance.