Skip to main content
← Blog

Compared · Associate Cloud Engineer · Professional Cloud Architect

GCP Basic vs Predefined vs Custom Roles

Every Google Cloud IAM question about least privilege comes down to which of three kinds of role to grant, and where in the resource hierarchy to grant it.

Published

The short answer: basic roles (Owner, Editor, Viewer) are highly permissive, each carrying thousands of permissions across every Google Cloud service; Google says not to grant them in production unless there is no alternative. Predefined roles give granular access to one service, such as roles/compute.instanceAdmin.v1, and Google maintains them as services change; they are the default choice. Custom roles contain exactly the permissions you list, for when no predefined role fits; you create them in an organization or project and you maintain them yourself. On the exam, the right answer is almost always the narrowest predefined role, and a custom role only when the scenario says the predefined roles carry permissions the user must not have.

Side by side

BasicPredefinedCustom
What it isOwner, Editor, ViewerService-specific roles defined by GoogleA role you define from a list of permissions
BreadthThousands of permissions across all servicesOne service or job functionExactly what you list
Maintained byGoogleGoogle, updated automatically as neededYou
Name formatroles/editorroles/SERVICE.IDENTIFIERprojects/ID/roles/NAME or organizations/ID/roles/NAME
Created atBuilt inBuilt inOrganization or project; not folders
Google's guidanceAvoid in productionPrefer theseUse when no predefined role fits

Definitions, name formats and guidance are from Google's Roles and permissions overview.

Basic roles: Owner, Editor, Viewer

These existed before IAM, and Google now labels them legacy. Viewer grants read-only actions that don't change state. Editor is Viewer plus actions that modify state, which for most services includes creating and deleting resources. Owner is Editor plus administrative tasks such as managing roles and permissions for the project and setting up billing. A notable detail from Google's docs: Owner doesn't contain every permission for every resource.

The problem is breadth. Granting Editor so someone can restart VMs also lets them change Cloud SQL instances, Pub/Sub topics and almost everything else in the project. That makes basic roles convenient for a personal sandbox and dangerous anywhere else.

Predefined roles: the default answer

Predefined roles are built per service and per job: Compute Instance Admin (v1) for managing VM instances, Storage Object Viewer for reading objects, BigQuery Data Viewer for reading datasets, Billing Account Viewer for seeing costs. Google adds permissions to them as services gain features, so a team using predefined roles doesn't need to chase API changes. When a question asks for least privilege "that Google keeps up to date", it is pointing straight at a predefined role.

Custom roles: when nothing fits exactly

A custom role is a list of permissions you choose. Use one when the closest predefined role includes permissions the user must not have. Google's docs list the rules that exam questions lean on:

  • You create a custom role in an organization or a project. You can't define one at the folder level.
  • A project-level custom role can only be granted within that project; an organization-level one can be used across the organization.
  • You are responsible for maintaining it. When Google adds a permission your team needs, nothing updates the role for you.
  • Some permissions can't be included in custom roles at all, so check support levels before you design one.

Where you grant matters as much as what

A role is granted to a principal on a resource: an organization, folder, project or, for many services, an individual resource such as a bucket. Allow policies are inherited downward, and the effective policy on a resource is the union of its own policy and its ancestors'. That has two consequences. Granting a role on a folder gives it on every project under that folder, which widens access. And a narrower grant lower down can't take away a broader one from above: if someone has Editor on the project, granting them Viewer on one topic leaves them with Editor on it. Removing access means removing the higher grant (or using a deny policy).

Two more tools sit beside roles. IAM Conditions limit when or on which resources a binding applies; they don't remove individual permissions from a role. And the IAM role recommender compares each principal's granted permissions with what it actually used over up to the last 90 days, then suggests removing the role or replacing it with a smaller one. It never suggests a change that increases access, and recommendations to shrink basic roles are flagged because they cut the most excess.

When to use which

  • Personal test project, one person, nothing sensitive: a basic role is acceptable.
  • A user needs to manage one service: the narrowest predefined role for that service, on the project or the specific resource.
  • A group needs an exact set of permissions and every predefined role has extras: a custom role in that project or organization.
  • The same custom role is needed in many projects: create it at the organization level.
  • Find out who is over-privileged across the organization: IAM role recommendations.
  • Access only during business hours or only to resources with a certain name prefix: keep the role, add an IAM Condition.

Exam traps

  • "Viewer is narrow." It is still a basic role with read access to almost every service. Swapping Editor for Viewer isn't least privilege.
  • Custom role that copies a basic role. Same breadth, plus you now maintain it. Always wrong.
  • Moving the grant up to a folder. That widens access to every project in the folder. Moving down to a single resource narrows where the role applies but not which permissions it has.
  • Custom roles at folder level. Not possible. Organization or project only.
  • Custom role when a predefined one fits. If the scenario doesn't mention unwanted extra permissions, the predefined role wins because Google maintains it.
  • Conditions to trim permissions. Conditions restrict context, not the permission list.

Practice questions from our bank

Two Associate Cloud Engineer questions and one Professional Cloud Architect question. Try each before opening the answer.

  1. Question 1 · Associate Cloud Engineer · Configuring access and security

    A developer was granted the basic Editor role (roles/editor) on a project, but their job only involves creating, starting, stopping and deleting Compute Engine VM instances. A security review asks for least-privilege access that Google keeps up to date as the service changes. What should the administrator do?

    • AReplace Editor with the predefined Compute Instance Admin (v1) role on the project
    • BReplace Editor with a custom role that copies all permissions from the Editor role
    • CReplace Editor with the basic Owner role (roles/owner) granted on the project
    • DKeep the Editor role but move the grant from the project up to its parent folder
    Show answer and explanation

    Answer: A) Replace Editor with the predefined Compute Instance Admin (v1) role on the project

    Basic roles such as Editor include thousands of permissions across all services. A service-specific predefined role like Compute Instance Admin (v1) gives least privilege and is maintained by Google.

    • ACorrect. Predefined roles give granular access for a specific service and are maintained by Google, which updates their permissions as features are added. Google recommends preferring them over broad basic roles.
    • BIncorrect. Copying Editor's permissions keeps the same broad access, so it doesn't meet least privilege. Custom roles also aren't updated by Google, which adds maintenance.
    • CIncorrect. Owner includes everything Editor has plus the ability to manage IAM and billing settings, so access gets even broader.
    • DIncorrect. A grant on a folder is inherited by every project in that folder, so the developer's broad access would cover more resources, not fewer.
  2. Question 2 · Associate Cloud Engineer · Configuring access and security

    Following least privilege, a team wants to give a group of operators exactly six specific permissions in one project. The closest predefined role contains those six permissions plus about twenty others that the operators must not have. What should the administrator do?

    • ACreate a custom role in the project containing only the six permissions, and grant it to the group
    • BGrant the group a basic role such as Viewer on the project, since basic roles are the most narrowly scoped
    • CGrant the closest predefined role with an IAM Condition attached that limits it to the six required permissions
    • DGrant the closest predefined role on a single resource instead of the whole project to remove the extra permissions
    Show answer and explanation

    Answer: A) Create a custom role in the project containing only the six permissions, and grant it to the group

    When no predefined role matches the exact set of permissions needed, a custom role lets you bundle only the permissions you need. Basic roles are too broad, and conditions or a narrower resource scope don't remove permissions from a role.

    • ACorrect. A custom role is user-defined and contains only the permissions listed for it, so it can match a set of permissions that no predefined role fits. A custom role created in a project can be granted within that project.
    • BIncorrect. Basic roles are highly permissive and grant broad access across many services. That is the opposite of the narrow, exact set of permissions the team needs.
    • CIncorrect. An IAM Condition controls when or on which resources a role binding applies, using attributes such as time or resource name. It doesn't remove individual permissions from a role, so the group would still get all the role's permissions whenever the condition is met.
    • DIncorrect. Granting at a lower level of the resource hierarchy narrows which resources the role applies to, but the role still includes all of its permissions, including the twenty unwanted ones.
  3. Question 3 · Professional Cloud Architect · Designing for security and compliance

    A security audit shows that many users and service accounts hold basic or broad predefined roles but use only a small fraction of the granted permissions. The organization wants Google Cloud to suggest smaller replacement roles based on the permissions each principal has actually used recently. Which capability meets this need?

    • ARole recommendations from the IAM recommender
    • BPolicy Analyzer queries on allow policies
    • CPolicy Troubleshooter access checks
    • DOrganization Policy Service constraints
    Show answer and explanation

    Answer: A) Role recommendations from the IAM recommender

    The IAM recommender uses recent permission usage to suggest removing or replacing over-privileged roles. Policy Analyzer and Policy Troubleshooter explain existing access, and organization policies constrain resource configuration.

    • ACorrect. The IAM recommender compares each principal's granted permissions with the permissions it used over the observation period (up to 90 days). It then recommends removing the role or replacing it with a smaller one.
    • BIncorrect. Policy Analyzer reports which principals have what access to which resources based on granted policies. It doesn't generate least-privilege role suggestions from usage.
    • CIncorrect. Policy Troubleshooter explains why a specific principal does or doesn't have a particular permission on a resource. It doesn't recommend narrower roles.
    • DIncorrect. Organization policies restrict how resources can be configured, such as allowed locations or disabling service account key creation. They don't analyze permission usage or right-size IAM roles.

Where this comes up on the exams

The Associate Cloud Engineer exam tests this hands-on in "Configuring access and security": choosing and granting roles, creating custom roles and managing service accounts. The Professional Cloud Architect exam frames it as design: least-privilege policies for whole organizations, where the role recommender and the resource hierarchy come in.

Related: the Azure equivalent, where two separate role systems exist side by side, is Azure RBAC vs Microsoft Entra roles. The theory underneath both is in DAC vs MAC vs RBAC vs ABAC.

Sources

Facts checked against the Google Cloud documentation on November 14, 2026.

Frequently asked questions

What are the three types of roles in Google Cloud IAM?

Basic roles (Owner, Editor, Viewer), which are broad and span all services; predefined roles, which give granular access to one service and are maintained by Google; and custom roles, which contain a list of permissions you choose.

Should I use basic roles in production?

Google's documentation says not to grant basic roles in production environments unless there is no alternative. Use the narrowest predefined or custom role that covers the task.

Can I create a custom role at the folder level?

No. Custom roles are created in an organization or a project. A project-level custom role can only be granted in that project.

When should I use a custom role instead of a predefined role?

When every predefined role that covers the task also grants permissions the user must not have. Otherwise prefer predefined roles, because Google updates them as services change and custom roles must be maintained by you.

Can a role granted on a resource reduce access granted on its project?

No. Allow policies are inherited and combined as a union, so a narrower role lower in the hierarchy doesn't remove a broader role granted higher up.