Diagram
A Venn diagram with IAM roles on the left and VM access scopes on the right; only their overlap is effective allowed access, with examples of cloud-platform and read-only scopes.
How IAM Roles and Access Scopes Combine on a Virtual Machine
IAM roles and access scopes together determine what a service account on a virtual machine (VM) instance can actually do. IAM roles granted to the service account define the maximum permissions available, while the instance access scopes define the default OAuth scopes used by the gcloud CLI and client libraries and can further limit API access. The best practice is to set the full cloud-platform access scope (https://www.googleapis.com/auth/cloud-platform) on the instance and then control access by granting IAM roles to the service account. If a restrictive scope is used instead, such as Cloud Storage read-only (https://www.googleapis.com/auth/devstorage.read_only), requests cannot manage objects even if the service account holds roles/storage.objectAdmin, because the scope does not authorize the change.
Domain 4 of 7
24 practice questions
Practice this DomainLast updated