Google Cloud Platform (GCP) is Google’s public cloud: you create projects, enable APIs, and provision regional resources (VMs, buckets, serverless services) through the Console, the gcloud CLI, or tools such as Terraform. Unlike a single rented server, GCP splits ownership by service—storage, identity, networking, and observability each have their own APIs and IAM surfaces.
This chapter opens the Google Cloud Platform series. You will deploy a small Express + TypeScript API that uploads and lists files in Cloud Storage, package it as a Docker image, and harden the path with IAM, VPC, Cloud Armor, and observability. The table below maps each later chapter to the capability it adds.
| Chapter | Service | What you add to the example |
|---|---|---|
| 2 | IAM | Service accounts for deploy and runtime |
| 3 | Artifact Registry | Store the app image |
| 4 | Cloud Run | Run the container |
| 5 | Cloud Storage | Persist uploaded files |
| 6 | Cloud Build | Build and deploy on git push |
| 7 | VPC | Private egress and subnets |
| 8 | Cloud Armor | WAF and rate limits in front of Run |
| 9–10 | Logging & Monitoring | Structured logs, metrics, alerts |
For a comparable compute story on another cloud, see Azure Compute.
Resource hierarchy
GCP organizes resources in a tree:
flowchart TB org[Organization] org --> folder[Folders optional] folder --> project[Project] project --> resources[APIs buckets Run services VPCs]
An organization is the root for a company domain. Folders group projects (for example production vs sandbox). A project is the unit of billing, API enablement, and IAM: every bucket, Cloud Run service, and VPC network belongs to exactly one project ID.
Project IDs are globally unique strings you choose at creation time (for example my-file-api-dev). Project numbers are numeric identifiers some APIs return; keep the ID in your shell config and scripts.
Regions, zones, and locations
Most GCP services are regional or multi-regional. A region is a geographic area (for example europe-west1). Zones are isolated locations within a region (europe-west1-b); zonal resources (Compute Engine VMs, zonal disks) can fail if that zone has an outage.
Cloud Run, Artifact Registry, and many storage buckets are configured with a location (region or multi-region). Pick a region close to users and compliant with data residency. The series examples use europe-west1 unless you substitute your own.
| Concept | Meaning |
|---|---|
| Region | Deploy Cloud Run, subnets, regional buckets here |
| Zone | Finer placement for VMs and zonal disks |
| Multi-region | Cloud Storage classes that replicate across a continent |
Projects, billing, and APIs
Every API call is tied to a project. Billing must be enabled on that project (or on a billing account linked to it) before most services create billable resources.
Services are gated by APIs. Enable what you need once per project:
gcloud services enable \ run.googleapis.com \ artifactregistry.googleapis.com \ cloudbuild.googleapis.com \ storage.googleapis.com \ logging.googleapis.com \ monitoring.googleapis.comThe Console APIs & Services page shows the same list. If a gcloud command fails with “API not enabled,” run gcloud services enable SERVICE_NAME.
Set defaults so commands target the right project and region:
gcloud config set project YOUR_PROJECT_IDgcloud config set run/region europe-west1gcloud config set artifacts/location europe-west1gcloud, Application Default Credentials, and Cloud Shell
The Google Cloud SDK installs gcloud, bq, and other tools. Install from cloud.google.com/sdk or use the package manager for your OS.
Sign in for user credentials and create Application Default Credentials (ADC) for client libraries and Terraform:
gcloud auth logingcloud auth application-default loginVerify identity and project:
gcloud auth listgcloud config get-value projectCloud Shell is a browser VM with the SDK preinstalled and project auth already wired. Use it when you cannot install the SDK locally; the same commands in this series work there.
Modern storage workflows prefer gcloud storage over the legacy gsutil wrapper. The Google Cloud cheat sheet collects common commands.
The example app for this series
The sample app is a stateless HTTP API:
GET /healthreturns{ "ok": true }GET /fileslists object names in a bucket (implemented in the Cloud Storage chapter)POST /filesaccepts a multipart upload (same chapter)
Scaffold the repository locally:
{ "name": "gcp-series-file-api", "type": "module", "scripts": { "build": "tsc", "start": "node dist/server.js" }, "dependencies": { "express": "^4.21.0" }, "devDependencies": { "@types/express": "^4.17.21", "typescript": "^5.6.0" }}{ "compilerOptions": { "target": "ES2022", "module": "NodeNext", "moduleResolution": "NodeNext", "outDir": "dist", "strict": true, "esModuleInterop": true }, "include": ["src"]}import express from "express";
const port = Number(process.env.PORT) || 8080;const app = express();
app.get("/health", (_req, res) => { res.json({ ok: true });});
app.listen(port, () => { console.log(JSON.stringify({ severity: "INFO", message: `Listening on ${port}` }));});Cloud Run expects the container to listen on PORT (default 8080). The Dockerfile builds TypeScript and runs the compiled server:
FROM node:22-bookworm-slim AS buildWORKDIR /appCOPY package.json package-lock.json ./RUN npm ciCOPY tsconfig.json ./COPY src ./srcRUN npm run build
FROM node:22-bookworm-slimWORKDIR /appENV NODE_ENV=productionCOPY package.json package-lock.json ./RUN npm ci --omit=devCOPY --from=build /app/dist ./distENV PORT=8080EXPOSE 8080CMD ["node", "dist/server.js"]Build and run locally before you push an image:
npm installnpm run builddocker build -t file-api:local .docker run --rm -p 8080:8080 file-api:localcurl -s localhost:8080/healthLater chapters add the Storage client, environment variables for the bucket name, and a Cloud Build pipeline. You can also express the same infrastructure with Getting started with Terraform on Google Cloud if you prefer IaC over imperative gcloud steps.
How the series is structured
Each chapter is one focused service. You can read linearly or jump to a topic, but the hands-on steps assume the previous chapter’s resources exist (for example Artifact Registry before Cloud Run deploy).
Identity comes first: without service accounts and IAM bindings, automated deploys and runtime access to buckets fail with opaque permission errors. Registry and Run follow, then data (Cloud Storage), automation (Cloud Build), network controls (VPC, Cloud Armor), and finally observability.
Next: IAM in Google Cloud defines the deployer and runtime identities for this app.
Check your understanding
Question 1 of 6
0 of 6 checked