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.
Topics on this page
Section titled “Topics on this page”| 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 |
Service categories
Section titled “Service categories”| 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.
Regions and zones
Section titled “Regions and zones”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.
Resource hierarchy
Section titled “Resource hierarchy”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 gcloud CLI
Section titled “The gcloud CLI”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:
gcloud init # sign in, choose a project and default regiongcloud auth login # credentials for gcloud itselfgcloud auth application-default login # credentials for client libraries on your machine (ADC)gcloud config set project ordersportal-prodgcloud config set run/region europe-west2gcloud config list # show the active configuration
gcloud projects listgcloud services enable run.googleapis.com artifactregistry.googleapis.comgcloud compute instances listgcloud 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.
Free tier
Section titled “Free tier”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.
Identity and access management
Section titled “Identity and access management”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) androles/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.
Granting and reviewing access
Section titled “Granting and reviewing access”# 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 servicegcloud 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 removalgcloud projects add-iam-policy-binding ordersportal-prod \ --member group:orders-devs@example.test --role roles/run.developergcloud projects remove-iam-policy-binding ordersportal-prod \ --member group:orders-devs@example.test --role roles/run.developer
# Review who has whatgcloud projects get-iam-policy ordersportal-prod --format=jsongcloud 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.
Service accounts
Section titled “Service accounts”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.
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.clientgcloud run deploy orders-api --image .../orders-api:1.4.0 \ --service-account orders-api@ordersportal-prod.iam.gserviceaccount.comWorkloads 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-accountongcloudcommands, which requiresroles/iam.serviceAccountTokenCreatoron that account.
IAM conditions
Section titled “IAM conditions”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:
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.
Least privilege in practice
Section titled “Least privilege in practice”- Use predefined roles, never basic roles, in production projects.
- Grant at the narrowest scope that works: a bucket or a service before a project, a project before a folder.
- Grant to groups for people and to dedicated service accounts for workloads.
- Avoid service account keys; use attached service accounts, Workload Identity Federation and impersonation.
- Use conditions for temporary access, and deny policies for guardrails that must hold whatever is granted.
- Review access regularly with Policy Analyzer and the IAM recommender, and keep Cloud Audit Logs (Admin Activity logs are always on) for investigations.
- Set organization policies (for example, disable service account key creation, enforce public access prevention on buckets, restrict resource locations).
Interview questions
Section titled “Interview questions”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.
Related pages
Section titled “Related pages”- Google Cloud start page — reading order for the GCP section
- GCP compute: Cloud Run, functions and GKE — running code, with service accounts and Workload Identity Federation for GKE
- GCP data: Cloud Storage and BigQuery — bucket IAM, signed URLs and BigQuery access
- Azure vs AWS vs GCP — the three clouds side by side