Skip to content

Google Cloud Overview and IAM

Google Cloud (often still called Google Cloud Platform, GCP) is Google’s public cloud: compute, storage, databases, networking, data analytics, AI and developer tools, running on the same global infrastructure as Google’s own products. This page covers the foundations every other GCP page builds on: how services are grouped, where they run, how resources are organized into projects, how to use the gcloud CLI, and how Identity and Access Management (IAM) decides who can do what.

The running example is an invented OrdersPortal shop with production resources in the project ordersportal-prod, mostly in europe-west2 (London). Commands are for the current Google Cloud CLI and were checked against Google Cloud’s documentation in November 2026; they were not run here because they need a Google Cloud account.

Topic What it answers
Service categories What Google Cloud offers and the AWS and Azure equivalents
Regions and zones Where resources run and how to design for availability
Resource hierarchy Organizations, folders, projects and why projects matter
The gcloud CLI Installing, authenticating and configuring the CLI
Free tier What you can run at no cost
Identity and access management Principals, roles and allow policies
Granting and reviewing access Commands to add, remove and audit bindings
Service accounts Identities for workloads, and why to avoid keys
IAM conditions Time-limited and resource-scoped grants
Least privilege in practice A checklist for real projects
Category Main Google Cloud services AWS Azure
Virtual machines Compute Engine EC2 Virtual Machines
Serverless containers and functions Cloud Run, Cloud Run functions Lambda, App Runner, Fargate Container Apps, Functions
Kubernetes Google Kubernetes Engine (GKE) EKS AKS
Object storage Cloud Storage S3 Blob Storage
Relational databases Cloud SQL, AlloyDB, Spanner RDS, Aurora Azure SQL Database, Azure Database for PostgreSQL
NoSQL Firestore, Bigtable DynamoDB Cosmos DB
Data warehouse BigQuery Redshift Microsoft Fabric, Synapse Analytics
Messaging Pub/Sub, Eventarc SNS, SQS, EventBridge Service Bus, Event Grid
AI platform Vertex AI, Gemini API Bedrock, SageMaker Microsoft Foundry
CI/CD and artifacts Cloud Build, Artifact Registry, Cloud Deploy CodeBuild, ECR Azure Pipelines, Container Registry

The compute guide and the Cloud Storage and BigQuery guide go deeper on the services most applications start with.

A region is an independent geographic area such as europe-west2 (London) or us-central1 (Iowa). Each region has three or more zones (europe-west2-a, -b, -c), which are separate failure domains within it. Some services are zonal (a VM or a zonal disk lives in one zone), some are regional (Cloud Run, regional GKE clusters, regional buckets replicate across zones automatically), and some are multi-regional or global (multi-region buckets in EU or US, global load balancers).

Design rule of thumb: spread across zones for high availability, across regions for disaster recovery, and pick regions near users and in the jurisdictions your data must stay in. Not every service or machine type is available in every region, so check before you commit to one.

Organization (example.test)
└── Folder: production
└── Project: ordersportal-prod
└── Resources: Cloud Run services, buckets, BigQuery datasets, VMs...

Every resource belongs to exactly one project. A project is the unit of billing (it is linked to a billing account), of API enablement (each API is turned on per project), and the most common place to grant access. Projects have a globally unique ID (ordersportal-prod), a display name and a project number. An organization node exists when you use Google Workspace or Cloud Identity, and folders group projects by environment, team or product. IAM policies and organization policies set higher in the tree are inherited by everything below, which makes folders the right place for broad rules (“nobody can create public buckets in production”) and projects or individual resources the place for specific grants.

Pitfall: one project for everything. Separate projects for production, staging and development give you separate billing, quotas and access boundaries for free, and limit the blast radius of a mistake.

The Google Cloud CLI provides gcloud (most services), gcloud storage (Cloud Storage) and bq (BigQuery). Install it from Google’s installer or package repositories, then:

Terminal window
gcloud init # sign in, choose a project and default region
gcloud auth login # credentials for gcloud itself
gcloud auth application-default login # credentials for client libraries on your machine (ADC)
gcloud config set project ordersportal-prod
gcloud config set run/region europe-west2
gcloud config list # show the active configuration
gcloud projects list
gcloud services enable run.googleapis.com artifactregistry.googleapis.com
gcloud compute instances list

gcloud auth login and gcloud auth application-default login are separate on purpose: the first authorizes CLI commands, the second creates Application Default Credentials that client libraries in your local code use. Use named configurations (gcloud config configurations create staging) to switch between projects without retyping flags.

New customers get trial credits for a limited period, and the Always Free tier gives monthly usage at no charge in eligible accounts, subject to change. At the time of writing it includes, among others: one e2-micro Compute Engine VM per month in specific US regions, 5 GB-months of Standard Cloud Storage, 1 TB of BigQuery queries per month, 2 million Cloud Run requests per month, 2 million Cloud Run functions invocations per month, one GKE Autopilot or zonal cluster’s management fee, 1 GB of Firestore storage, 10 GB of Pub/Sub messages and 120 Cloud Build build-minutes per day. Set a budget with alerts on the billing account before experimenting; budgets alert but do not stop spending.

IAM answers one question for every API call: is this principal allowed to perform this permission on this resource? Access is granted with allow policies attached to resources (an organization, folder, project or individual resource such as a bucket). Each policy contains role bindings that grant a role to one or more principals.

Term Meaning Example
Principal Who is asking user:dana@example.test, group:orders-devs@example.test, serviceAccount:orders-api@ordersportal-prod.iam.gserviceaccount.com
Permission One action on one resource type storage.objects.get, run.services.update
Role A named collection of permissions roles/storage.objectViewer, roles/run.invoker
Allow policy Role bindings attached to a resource, inherited downwards Project policy granting roles/run.developer to a group

Other principal types include workforce and workload identity pools (people and workloads from external identity providers), and the special allUsers (anyone on the internet) and allAuthenticatedUsers (anyone with a Google account). Treat the last two as “public”.

Roles come in three kinds:

  • Basic roles (roles/owner, roles/editor, roles/viewer, formerly called primitive roles) span almost every service. Editor can change nearly everything. Avoid them in production.
  • Predefined roles are maintained by Google for each service, for example roles/storage.objectViewer (read objects), roles/run.invoker (call a Cloud Run service), roles/bigquery.dataViewer (read tables) and roles/container.developer (deploy to GKE). Start here.
  • Custom roles contain exactly the permissions you list. Use them when no predefined role is narrow enough, and accept that you now maintain them as services add permissions.

Effective access is the union of all bindings on the resource and its ancestors. Allow policies cannot take away access granted higher up; for that, Google Cloud has deny policies, which block specific permissions for specific principals regardless of allow bindings, and principal access boundary policies, which limit the resources a principal can access at all.

Terminal window
# Grant a group read access to objects in one bucket (narrowest useful scope)
gcloud storage buckets add-iam-policy-binding gs://ordersportal-exports \
--member group:orders-analysts@example.test \
--role roles/storage.objectViewer
# Grant a service account permission to invoke one Cloud Run service
gcloud run services add-iam-policy-binding orders-api --region europe-west2 \
--member serviceAccount:checkout@ordersportal-prod.iam.gserviceaccount.com \
--role roles/run.invoker
# Project-level grant and its removal
gcloud projects add-iam-policy-binding ordersportal-prod \
--member group:orders-devs@example.test --role roles/run.developer
gcloud projects remove-iam-policy-binding ordersportal-prod \
--member group:orders-devs@example.test --role roles/run.developer
# Review who has what
gcloud projects get-iam-policy ordersportal-prod --format=json
gcloud asset search-all-iam-policies --scope=projects/ordersportal-prod \
--query="policy:dana@example.test"

Grant to groups, not individual users, so joiners and leavers are handled in one place. Policy Analyzer and the IAM recommender (in the console) show unused permissions so you can shrink over-broad grants.

Pitfall: set-iam-policy with a stale file. Replacing a whole policy from a file you exported earlier silently removes any bindings added since. Prefer add-iam-policy-binding and remove-iam-policy-binding, which change one binding.

A service account is an identity for a workload rather than a person: a Cloud Run service, a GKE pod, a VM or a CI pipeline. Create one per workload and grant it only what that workload needs.

Terminal window
gcloud iam service-accounts create orders-api --display-name "OrdersPortal API"
gcloud projects add-iam-policy-binding ordersportal-prod \
--member serviceAccount:orders-api@ordersportal-prod.iam.gserviceaccount.com \
--role roles/cloudsql.client
gcloud run deploy orders-api --image .../orders-api:1.4.0 \
--service-account orders-api@ordersportal-prod.iam.gserviceaccount.com

Workloads running on Google Cloud get short-lived credentials for their attached service account automatically through Application Default Credentials; nothing is stored in code. Downloaded service account keys (JSON files) are long-lived secrets that leak through repositories, laptops and logs, and many organizations block their creation with an organization policy. Keyless alternatives cover almost every case:

  • On Cloud Run, Cloud Run functions and Compute Engine: attach the service account to the resource.
  • On GKE: Workload Identity Federation for GKE.
  • From GitHub Actions, GitLab, AWS or Azure: Workload Identity Federation, which exchanges the external platform’s token for short-lived Google credentials.
  • For a developer testing as the service account: --impersonate-service-account on gcloud commands, which requires roles/iam.serviceAccountTokenCreator on that account.

Conditions make a binding apply only when a Common Expression Language (CEL) expression is true, for example only until a date, or only for resources whose names start with a prefix:

Terminal window
gcloud projects add-iam-policy-binding ordersportal-prod \
--member user:contractor@example.test \
--role roles/viewer \
--condition='expression=request.time < timestamp("2027-01-31T00:00:00Z"),title=contract-ends-jan-2027'

Time-bound conditions are a good fit for temporary access, so you do not depend on someone remembering to remove it. Not every role and resource type supports conditions; the IAM documentation lists which do.

  1. Use predefined roles, never basic roles, in production projects.
  2. Grant at the narrowest scope that works: a bucket or a service before a project, a project before a folder.
  3. Grant to groups for people and to dedicated service accounts for workloads.
  4. Avoid service account keys; use attached service accounts, Workload Identity Federation and impersonation.
  5. Use conditions for temporary access, and deny policies for guardrails that must hold whatever is granted.
  6. Review access regularly with Policy Analyzer and the IAM recommender, and keep Cloud Audit Logs (Admin Activity logs are always on) for investigations.
  7. Set organization policies (for example, disable service account key creation, enforce public access prevention on buckets, restrict resource locations).

1. Why is the project the most important boundary in Google Cloud? It is where billing, API enablement, quotas and most IAM grants meet. Separate projects per environment and workload give isolation of cost, access and blast radius without extra configuration.

2. A developer has roles/editor on the project. What is the risk, and what do you replace it with? Editor can create, change and delete almost every resource, including data, though not IAM policies. Replace it with predefined roles for the services they work on (for example roles/run.developer and roles/storage.objectUser on specific buckets), granted to a group, ideally only in non-production projects.

3. How should a GitHub Actions workflow deploy to Cloud Run without a service account key? Configure Workload Identity Federation with a provider for GitHub’s OIDC tokens, restricted to the specific repository and branch, and allow it to impersonate a deployer service account that has only the roles needed to deploy. The workflow exchanges its OIDC token for short-lived credentials on each run.

4. Can an allow policy on a bucket remove access a user has from the project? No. Allow policies are additive and inherited, so a project-level grant applies to every bucket in it. To block it you need a deny policy, or to remove the project-level grant and grant at the bucket level instead.

5. Senior scenario: you inherit an OrdersPortal organization with 40 projects, many basic-role grants and 200 service account keys. What is your plan? First get visibility: export IAM policies and the key inventory with Cloud Asset Inventory, and use the IAM recommender and key usage data to find unused grants and keys. Stop new damage with organization policies (block key creation, enforce public access prevention, restrict domains in IAM). Then replace keys per workload with attached service accounts, Workload Identity Federation for CI and GKE, and impersonation for people, disabling each key before deleting it. Replace basic roles with predefined roles granted to groups, starting with production. Track progress with a dashboard of remaining keys and basic-role bindings.