Understanding GCP IAM Roles: Basic, Predefined & Custom
A comprehensive guide to understanding the three types of GCP IAM roles and how to choose the right access control approach for your Google Cloud environment.
Access control is a critical component of any cloud environment, and understanding GCP IAM roles is essential for anyone working with Google Cloud Platform. Whether you're preparing for the Professional Data Engineer certification or managing production workloads, knowing the difference between basic, predefined, and custom roles will help you design secure, maintainable access control systems that follow the principle of least privilege.
Google Cloud's Identity and Access Management (IAM) system provides three distinct types of roles, each serving different purposes in your security architecture. Choosing the right type of role impacts both security and operational efficiency.
What Are GCP IAM Roles?
GCP IAM roles are collections of permissions that define what actions a user, service account, or group can perform on Google Cloud resources. Rather than assigning individual permissions one at a time, you grant roles that bundle related permissions together. This approach simplifies access management while maintaining granular control over who can do what in your environment.
Every role in Google Cloud consists of one or more permissions. A permission follows the format service.resource.verb
, such as bigquery.datasets.get
or storage.objects.create
. Roles group these permissions logically based on job functions, service boundaries, or custom requirements.
Basic Roles: The Foundation of GCP IAM Roles
Basic roles represent the broadest level of access in Google Cloud and existed before the more granular predefined and custom roles were introduced. There are exactly three basic roles, and they apply across all services and resources within a project.
Owner Role
The Owner role provides complete control over all resources in a project. Users with this role can perform any action, including managing IAM policies and permissions for other users. Project administrators and team leads typically receive the Owner role because they need full authority to manage the project lifecycle, billing, and team access.
When a hospital network launches a new Google Cloud project to analyze patient readmission patterns, the IT director would receive the Owner role to configure the project, set up billing, and grant appropriate access to the data engineering team.
Editor Role
The Editor role grants read and write access to almost all resources but excludes the ability to manage IAM policies or permissions. This role suits developers and operators who need to create, modify, and delete resources but don't require project administration capabilities.
Consider a mobile game studio where developers need to deploy Cloud Functions for player matchmaking and update Cloud Storage buckets with game assets. These developers would receive the Editor role, allowing them to work productively without the risk of accidentally modifying critical security settings.
Viewer Role
The Viewer role provides read-only access across all resources. Users can examine configurations, view data, and monitor systems but cannot make any changes. This role works well for auditors, compliance officers, or external consultants who need visibility without modification capabilities.
A regulatory auditor reviewing a payment processor's data handling practices might receive the Viewer role to inspect BigQuery datasets, Cloud Storage bucket configurations, and logging policies without any ability to alter the environment.
When to Use Basic Roles
Basic roles offer simplicity but provide very broad access. They work well in development environments, small teams, or proof-of-concept projects where administrative overhead outweighs security concerns. However, production environments handling sensitive data should typically use more restrictive predefined or custom roles to implement proper least-privilege access control.
Predefined Roles: Service-Specific GCP IAM Roles
Predefined roles are curated collections of permissions tied to specific Google Cloud services and designed to match common job functions. Google Cloud maintains these roles, updating them as services evolve and new features are added. Predefined roles strike a balance between the broad access of basic roles and the precise control of custom roles.
Common Predefined Role Examples
Google Cloud offers hundreds of predefined roles across its service catalog. The BigQuery Job User role allows running jobs such as queries and data loads without granting access to modify datasets. The Storage Object Viewer role provides read-only access to Cloud Storage objects without the ability to create or delete them. The Cloud Run Developer role enables deploying and managing Cloud Run services while restricting access to other resources.
The Compute Engine Admin role grants full control over virtual machines, disks, and related Compute Engine resources. The Cloud Functions Developer role allows deploying and managing Cloud Functions without broader project access. The BigQuery Data Editor role permits editing datasets and table schemas while restricting job execution capabilities.
Understanding Predefined Role Composition
Each predefined role bundles multiple granular permissions. Consider the Composer User role, which enables working with Cloud Composer (Google Cloud's managed Apache Airflow service). This single role includes composer.dags.execute
to run directed acyclic graphs, composer.environments.get
to view environment details, secretmanager.versions.access
to retrieve secrets used in workflows, and serviceusage.services.list
to enumerate enabled APIs.
Together, these permissions create a cohesive capability set. A data engineer at a freight company orchestrating data pipelines doesn't need each permission assigned individually. The Composer User role provides exactly what's needed to manage workflows without excess privileges.
Similarly, the Storage Object Creator role bundles permissions for creating objects, managing folders, and handling multipart uploads in Cloud Storage. An application service account uploading sensor telemetry from agricultural monitoring equipment needs these specific capabilities, which the predefined role delivers without granting unnecessary read or deletion rights.
Benefits of Predefined Roles
Predefined roles reduce administrative burden by grouping permissions logically. You don't need to research every permission required for a task or worry about missing critical permissions that would break functionality. Google Cloud has already analyzed common usage patterns and assembled appropriate permission sets.
These roles also stay current automatically. When Google Cloud adds new features to a service, the relevant predefined roles receive corresponding permissions. A video streaming service using the BigQuery Data Editor role automatically gains access to new BigQuery capabilities without manual intervention.
Custom Roles: Tailored GCP IAM Roles
Custom roles give you complete control over permission composition. Unlike basic and predefined roles managed by Google Cloud, you create and maintain custom roles yourself, selecting exactly which permissions to include. This precision enables implementing strict least-privilege policies when predefined roles are either too broad or don't match your specific requirements.
When Custom Roles Make Sense
Custom roles work well in highly regulated environments where compliance mandates precise access control. Consider FinSecure, a financial services company operating under strict regulatory oversight. Their data analysts need to view and query BigQuery datasets containing transaction records, run Dataflow jobs to process payment data, read Cloud Storage objects storing customer documentation, and access Compute Engine logs for troubleshooting pipeline issues.
No single predefined role provides exactly this combination. The BigQuery Data Viewer role lacks Dataflow permissions. The Dataflow Admin role grants excessive modification capabilities. Creating a custom "FinSecure Data Analyst" role solves this problem:
title: FinSecure Data Analyst
description: Custom role for data analysts with limited cross-service access
stage: GA
includedPermissions:
- bigquery.datasets.get
- bigquery.tables.get
- bigquery.tables.getData
- bigquery.jobs.create
- dataflow.jobs.get
- dataflow.jobs.list
- storage.objects.get
- storage.objects.list
- compute.instances.getSerialPortOutput
This custom role grants precisely the necessary permissions without overexposure. Analysts can perform their jobs effectively while FinSecure maintains compliance with financial regulations requiring documented access controls.
Creating Custom Roles
You can create custom roles through the Google Cloud Console, gcloud command-line tool, or IAM API. Here's an example using gcloud to create a custom role for a telehealth platform where support staff need limited diagnostic capabilities:
gcloud iam roles create telehealth_support_analyst \
--project=telehealth-prod-project \
--title="Telehealth Support Analyst" \
--description="Limited access for troubleshooting patient session issues" \
--permissions=logging.logEntries.list,monitoring.timeSeries.list,cloudfunctions.functions.get \
--stage=GA
This role allows support staff to view logs and monitoring metrics for troubleshooting without accessing patient health data or modifying infrastructure.
Custom Role Limitations and Considerations
Custom roles require ongoing maintenance. When you need to add or remove permissions, you must update the role definition manually. This differs from predefined roles that Google Cloud maintains automatically. You're responsible for tracking which permissions are necessary as your application evolves.
Custom roles also have some technical constraints. They can only be created at the organization or project level, not at the folder level. Additionally, there's a limit to how many custom roles you can create per organization (typically 300, though this can be increased).
The permissions you include must be supported for custom roles. Some permissions are reserved for predefined roles only, particularly those involving sensitive security operations.
Choosing the Right GCP IAM Role Type
Selecting between basic, predefined, and custom roles depends on your security requirements, operational complexity, and team size.
Use basic roles when working in development or sandbox environments where speed matters more than security granularity. A small startup testing a proof-of-concept for climate modeling might assign Editor roles to the entire engineering team for maximum agility.
Choose predefined roles for production environments where Google Cloud's curated permission sets align with your needs. A podcast network running transcription workflows with Cloud Speech-to-Text and storing audio in Cloud Storage would use predefined roles like Storage Object Admin and Cloud Speech Client rather than building custom alternatives.
Create custom roles when compliance requirements, security policies, or unique business needs demand permission combinations that predefined roles don't provide. A solar farm monitoring system with strict operational technology security might need custom roles that blend IoT device management permissions with limited data analysis capabilities.
Integration with Google Cloud Services
GCP IAM roles work uniformly across all Google Cloud services, creating consistent access control regardless of which services your architecture uses. When a user or service account has a role granting BigQuery permissions, those permissions apply to all BigQuery resources they're authorized to access.
Roles can be assigned at multiple levels in the Google Cloud resource hierarchy: organization, folder, project, or individual resource. Permissions are inherited downward, so a role granted at the project level applies to all resources within that project.
Service accounts, which represent applications rather than human users, also receive roles. A Cloud Run service processing orders for a subscription box service might have a service account with the BigQuery Data Editor role to update customer analytics tables and the Cloud Storage Object Creator role to archive order confirmations.
This unified approach means you learn the role concepts once and apply them everywhere. Whether you're securing Dataflow pipelines, Pub/Sub topics, or Vertex AI models, the same role assignment mechanisms and permission models apply.
Practical Implementation Patterns
In real-world environments, you'll typically use a combination of role types. A university system managing research data might have two senior IT administrators as Project Owners with full control. Researchers receive BigQuery User for running queries and Storage Object Viewer for accessing shared datasets. Grant review committees get a custom "Research Data Auditor" role with read-only access to specific dataset metadata and usage logs but not the underlying research data.
Another common pattern involves using predefined roles as templates for understanding permission needs, then creating custom roles that narrow access further. You might examine the BigQuery Admin role to understand what permissions data pipeline administrators typically need, then create a custom role removing table deletion and dataset-level modification permissions for junior engineers.
Understanding GCP IAM Roles for Certification Success
Professional Data Engineer exam candidates should understand when each role type is appropriate and how to implement least-privilege access. The exam may present scenarios requiring you to recommend role assignments for data engineers, analysts, or automated systems, testing your ability to balance functionality with security.
Focus on understanding the permission boundaries between roles. Know that basic roles are too broad for production data systems handling sensitive information. Recognize situations where predefined roles like BigQuery Data Editor or Dataflow Developer provide the right scope. Identify cases where custom roles are necessary, such as cross-service workflows with specific permission requirements that no single predefined role addresses.
Roles are collections of permissions designed to enable job functions. Whether you're granting access to a data scientist at a genomics lab, configuring service account permissions for a real-time analytics pipeline, or implementing compliance controls for a healthcare platform, you're selecting the role type that provides necessary capabilities without excess privileges.
Moving Forward with GCP IAM Roles
GCP IAM roles provide a flexible, hierarchical approach to access control across Google Cloud Platform. Basic roles offer simplicity with broad access, predefined roles balance convenience with service-specific granularity, and custom roles deliver precise control for specialized requirements. Understanding these three role types and knowing when to use each one enables you to build secure, maintainable cloud environments that follow security best practices while supporting operational needs.
Whether you're managing a small project or architecting enterprise-scale data platforms, choosing appropriate GCP IAM roles is fundamental to protecting your resources and data. Start with predefined roles when they fit your needs, create custom roles when they don't, and reserve basic roles for non-production environments where simplicity outweighs security concerns.
For those preparing for the Professional Data Engineer certification, mastering IAM roles is essential since access control appears throughout the exam in contexts ranging from data pipeline security to cross-project analytics. If you're looking for comprehensive exam preparation that covers IAM alongside all other Data Engineer topics, check out the Professional Data Engineer course for structured learning and hands-on practice.