In this workshop you build your own small platform on Google Kubernetes Engine (GKE), starting from an empty Terraform file. You are expected to lean heavily on AI tools (Claude Code, Copilot, Cursor, ChatGPT, …) to write the code. The goal is not to type every line yourself, but to understand what you build, make good decisions, and get it running.
This repo only gives you the starting point: terraform.tf with the provider setup for the shared workshop project. Everything else you build in main.tf (and any other files you like).
Install these before the workshop:
| Tool | Notes |
|---|---|
| gcloud CLI | brew install --cask google-cloud-sdk |
Terraform >= 1.17 |
We recommend tenv (brew install tenv). It reads .terraform-version and installs the right version for you. |
| kubectl | brew install kubectl |
| gke-gcloud-auth-plugin | gcloud components install gke-gcloud-auth-plugin. See troubleshooting if kubectl can't find it. |
| An AI coding tool | Whichever you prefer. An agent that can run commands in your terminal (e.g. Claude Code) works especially well. |
-
Log in to Google Cloud. You need both logins: the first is for
gcloud, the second is what Terraform uses.gcloud auth login gcloud auth application-default login gcloud config set project cloud-labs-workshop-42clwsTerraform gets the project from
terraform.tf, butgcloud(and any AI agent runninggcloudcommands for you) needs it set as the default. -
Create
main.tfwith a unique id. Use something short and lowercase, like your name. It is used to prefix all your resources so they don't collide with other participants'.locals { id = "yourname" }
-
Initialize and check that everything works.
terraform init terraform apply
The apply should create nothing, and print
current_user_emailwith your email. If it does, you're ready.
- Terraform and provider versions: Terraform
>= 1.17and the Google provider. - Provider config: the workshop project, region
europe-west1and zoneeurope-west1-b. Resources you create use these defaults unless you say otherwise. current_user_emailoutput: shows which Google account Terraform is running as.id_is_setcheck: warns you iflocal.idis empty.
Don't change this file unless you know why.
Everyone works in the same GCP project, so:
- Prefix every resource name with
${local.id}, e.g."${local.id}-cluster". - Don't enable or disable project APIs (
google_project_service) from your Terraform. Destroying it would turn the API off for everyone. Ask a facilitator if an API is missing. - Keep it small. Use a zonal cluster and small machine types (e.g.
e2-standard-2). We have limited quota. - Clean up afterwards with
terraform destroy. Setdeletion_protection = falseon your cluster, or destroy will fail. - Never run destroy or delete commands on resources you don't own. Be careful when your AI tool suggests
gcloudcommands, and check what they target.
The workshop is 3 hours, and is the first in a series: later workshops build further on the platform you start today. So don't worry about getting everything done, but do aim to finish steps 1–3.
Each step lists what to aim for. How you get there, and which AI prompts you use, is up to you. Everything happens locally on your machine. Committing to your local clone after each step is a good habit: it gives you a checkpoint to go back to if your AI tool takes a wrong turn.
Create a VPC network, a subnet and a GKE cluster with a node pool, all in Terraform. Creating the cluster takes around 10 minutes, so use the time to read up on what you're creating.
Done when: kubectl get nodes shows at least one Ready node.
Things to think about: Why remove the default node pool? What are secondary IP ranges used for? Zonal or regional?
Tip: gcloud container clusters get-credentials <cluster> --zone europe-west1-b sets up kubectl for your cluster. Make it a Terraform output.