Photo by Yosuke Ota on Unsplash

On this page

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:

Diagram 1
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:

Terminal window
gcloud services enable \
run.googleapis.com \
artifactregistry.googleapis.com \
cloudbuild.googleapis.com \
storage.googleapis.com \
logging.googleapis.com \
monitoring.googleapis.com

The 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:

Terminal window
gcloud config set project YOUR_PROJECT_ID
gcloud config set run/region europe-west1
gcloud config set artifacts/location europe-west1

gcloud, 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:

Terminal window
gcloud auth login
gcloud auth application-default login

Verify identity and project:

Terminal window
gcloud auth list
gcloud config get-value project

Cloud 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 /health returns { "ok": true }
  • GET /files lists object names in a bucket (implemented in the Cloud Storage chapter)
  • POST /files accepts a multipart upload (same chapter)

Scaffold the repository locally:

package.json
{
"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"
}
}
tsconfig.json
{
"compilerOptions": {
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"outDir": "dist",
"strict": true,
"esModuleInterop": true
},
"include": ["src"]
}
src/server.ts
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:

Dockerfile
FROM node:22-bookworm-slim AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY tsconfig.json ./
COPY src ./src
RUN npm run build
FROM node:22-bookworm-slim
WORKDIR /app
ENV NODE_ENV=production
COPY package.json package-lock.json ./
RUN npm ci --omit=dev
COPY --from=build /app/dist ./dist
ENV PORT=8080
EXPOSE 8080
CMD ["node", "dist/server.js"]

Build and run locally before you push an image:

Terminal window
npm install
npm run build
docker build -t file-api:local .
docker run --rm -p 8080:8080 file-api:local
curl -s localhost:8080/health

Later 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

  1. 1. What is the usual billing and IAM boundary for buckets, Cloud Run services, and VPC networks?

Search articles

Type a word to search published articles.

Open the search page