Explains Google Cloud IAM permissions, roles, policy structure, best practices and tooling to enforce least privilege across BigQuery, Cloud Storage, Compute Engine and other resources.
Hello and welcome back.Cloud IAM and the principle of least privilege — the idea that identities should have only the access they truly need — are foundational to secure Google Cloud operations. This lesson goes deeper into IAM permissions and roles to answer the core question: who can do what on which resource?Understanding these concepts is critical for data engineers and cloud operators because they determine how securely you interact with BigQuery datasets and tables, Cloud Storage buckets and objects, Compute Engine instances, and other Google Cloud resources.
Permissions are the atomic unit of access control in IAM. A permission authorizes a specific action on a resource type. Examples:
bigquery.tables.get — read metadata for a BigQuery table
bigquery.tables.update — modify a table
storage.objects.create — upload an object to a Cloud Storage bucket
compute.instances.start — start a Compute Engine VM
Permissions follow a structured naming scheme: service.resource.action (or service.action). Note that you cannot grant individual permissions directly to a member; you grant roles that bundle permissions.
Permissions are granted through IAM policies attached to resources. A policy is a collection of bindings. Each binding associates a role to one or more members and can include an optional condition.Example policy (JSON):
gcloud iam roles describe roles/bigquery.dataViewer --format="yaml(includedPermissions)"
Shows included permissions.
Create a project-scoped custom role
gcloud iam roles create myCustomRole --project=PROJECT_ID --title="My Custom Role" --description="Custom role for ETL tasks" --permissions=bigquery.tables.get,bigquery.tables.update,storage.objects.get --stage=GA
Replace PROJECT_ID and adjust permissions.
Use the Policy Troubleshooter and IAM Policy Simulator in the Cloud Console to validate whether a member has a specific permission on a resource.
Always follow the principle of least privilege: grant only the roles and permissions required. Prefer predefined roles for common tasks, and create custom roles only when necessary.
Analyst who needs read-only access across datasets: grant roles/bigquery.dataViewer at the project or dataset level.
ETL service account that loads data into BigQuery and writes to Cloud Storage: grant a combination such as roles/bigquery.dataEditor (or a narrower custom role) plus roles/storage.objectCreator on the target bucket(s).
When cross-project access is required, consider granting roles at the project level of the target project (not the source) or using IAM service account impersonation with limited roles.
This lesson covers the core IAM concepts you need to manage access securely across Google Cloud services. Apply these patterns to your BigQuery, Cloud Storage, and Compute Engine workflows for secure, least-privilege access.