Archive · GCP

GCP Basics: Compute Engine, VPC and Cloud Storage

Launch a VM in a custom network and use a bucket, with the differences from AWS.

1 min read

  • Compute Engine
  • VPC
  • Cloud Storage

VPC. A GCP VPC is global; subnets are regional. Firewall rules apply to the whole network and match by tag or service account.

gcloud compute networks create app-vpc --subnet-mode=custom
gcloud compute networks subnets create app-mumbai --network=app-vpc \
  --region=asia-south1 --range=10.30.0.0/24
gcloud compute firewall-rules create allow-ssh-iap --network=app-vpc \
  --allow=tcp:22 --source-ranges=35.235.240.0/20

That source range is for Identity-Aware Proxy, which lets you SSH without a public IP.

Compute Engine.

gcloud compute instances create vm-demo --zone=asia-south1-a \
  --machine-type=e2-small --subnet=app-mumbai --no-address \
  --image-family=ubuntu-2404-lts-amd64 --image-project=ubuntu-os-cloud
gcloud compute ssh vm-demo --zone=asia-south1-a --tunnel-through-iap

Cloud Storage.

gcloud storage buckets create gs://demo-ci-2025-assets --location=asia-south1 \
  --uniform-bucket-level-access --public-access-prevention
gcloud storage cp backup.tar.gz gs://demo-ci-2025-assets/

Delete test VMs and unattached disks when finished; stopped VMs still bill for their disks and reserved IPs.