BeginnerLesson 1 of 12

GCP Fundamentals

Understand Google Cloud Platform architecture, global infrastructure, and how to navigate the Console and CLI.

Simple Explanation (ELI5)

Google Cloud Platform (GCP) is a cloud provider like AWS and Azure. Imagine GCP as a global network of data centers. You can rent computers (VMs), storage buckets, databases, and other services without owning hardware. GCP organizes its infrastructure into Regions (geographic areas) and Zones (specific data centers within regions). Everything runs in these zones, and you choose where your data lives.

Why Do We Need It?

Technical Explanation

GCP is organized hierarchically: Domains (your organization) contain Projects (isolated billing units), which contain Resources (VMs, databases, networks). Each project runs in one or more Regions. Each Region contains 2+ independent Zones. Zones are connected by very low-latency links within a region, but inter-regional traffic incurs bandwidth fees.

GCP Infrastructure Model

LevelDescriptionExample
OrganizationTop-level container (optional)Acme Corporation
ProjectBilling and resource groupingmy-app-prod
RegionGeographic area (e.g., us-central1)us-central1 (Iowa)
ZoneSpecific data centerus-central1-a
ResourceCompute, storage, database instancesVM instance, Cloud Storage bucket

Key GCP Regions & Zones

RegionGeographyUse Case
us-central1Iowa, USADefault, most services available
us-east1South Carolina, USAUS East Coast services
us-west1Oregon, USAUS West Coast services
europe-west1Belgium, EuropeGDPR compliance, European users
asia-east1Taiwan, AsiaSoutheast Asian users

GCP Console & CLI

1. GCP Console (Web UI)

The GCP Console is your web-based dashboard at console.cloud.google.com. You can:

2. GCP CLI (gcloud)

The gcloud CLI is the command-line interface for GCP. Install it and authenticate:

bash
curl https://sdk.cloud.google.com | bash
exec -l $SHELL
gcloud init
gcloud auth login

Common gcloud Commands

bash
# Set default project
gcloud config set project MY_PROJECT_ID

# Create a Compute Engine VM
gcloud compute instances create my-vm --zone us-central1-a --machine-type n1-standard-1

# List all VMs
gcloud compute instances list

# SSH into a VM
gcloud compute ssh my-vm --zone us-central1-a

# View current configuration
gcloud config list

# Enable a service (e.g., Compute Engine API)
gcloud services enable compute.googleapis.com

Hands-on: First Steps in GCP

  1. Create a GCP project: Visit console.cloud.google.com, click the project dropdown, and select "New Project". Name it "my-first-project".
  2. Enable Compute Engine API: Search for "Compute Engine" in the console and click "Enable".
  3. Install gcloud CLI locally (see steps above).
  4. Authenticate: Run gcloud init and select your new project.
  5. List available zones: gcloud compute zones list

Debugging Scenarios

Scenario 1: "gcloud: command not found"

Symptom: You installed the SDK but gcloud CLI is not available in your terminal.

Scenario 2: "Default credentials have not been set"

Symptom: Running a gcloud command fails with authentication error.

Interview Questions

Beginner

What is GCP and how does it compare to AWS and Azure?

GCP is Google's cloud platform offering compute, storage, databases, and analytics services globally. vs AWS: AWS is older with broader service catalog; GCP excels at data analytics and machine learning. vs Azure: Azure integrates with Microsoft ecosystem; GCP is developer-friendly and cheaper for analytics workloads.

What is a GCP Project?

A Project is a container for resources with its own billing, IAM roles, and APIs. All GCP resources (VMs, buckets, databases) belong to a project.

What is the difference between a Region and a Zone?

A Region is a geographic area (e.g., us-central1). A Zone is a specific data center within a region (e.g., us-central1-a). Zones within a region have very low latency; inter-region traffic is slower and costlier.

How do I authenticate to GCP from the CLI?

Run gcloud auth login, which opens your browser to authenticate. You can also use service account keys for automation.

What service is equivalent to AWS S3 in GCP?

Cloud Storage. Both offer object storage with similar pricing and redundancy models. Bucket names must be globally unique.

Intermediate

How does GCP's hierarchical organization work?

Organization → Folders → Projects → Resources. This allows centralized billing and IAM policies at the organization level that cascade to all projects and resources.

Why would you choose one zone over another in a region?

Zones are independent. You choose based on: (1) resource availability (not all services in all zones), (2) diversification for fault tolerance (spread instances across zones), (3) latency to users within the region.

What is the workflow to deploy a resource in GCP?

1. Create a project, 2. Enable the required API (e.g., Compute Engine), 3. Set billing, 4. Create the resource via Console or CLI, 5. Assign IAM roles for access.

Why enable APIs proactively?

GCP only allows API calls after the API is explicitly enabled on the project. Without enabling, requests fail with "API not enabled" errors. This improves security (only enabled services consume quota and can be billed).

Scenario-based

Your app needs to serve users in the US and Europe with minimal latency. How do you structure the deployment?

Deploy instances in us-central1 for US traffic and europe-west1 for European traffic. Use a global load balancer to route requests to the nearest region. Replicate data across regions respecting GDPR residency requirements.

Real-world Usage

Most GCP projects start by creating a project, enabling Compute Engine, and launching a test VM. As workloads grow, teams organize with folders (dev/stage/prod), implement centralbudgeting, and configure IAM roles per team. BigQuery often becomes the analytics backbone for downstream analysis.

Summary

GCP is a powerful cloud platform with a clear hierarchical organization (Org → Project → Zone → Resource). The Console offers UI-based management; gcloud CLI enables automation. Zones and regions are key to latency and redundancy strategies. Mastering these fundamentals sets the foundation for deploying compute, storage, databases, and everything else in GCP.