User-defined Playground

OpenTofu with Google Cloud CLI Playground

A disposable OpenTofu development environment with the gcloud SDK, tofu, kubectl, and the GKE auth plugin pre-installed.

OpenTofu with Google Cloud CLI playground: A disposable OpenTofu development environment with the gcloud SDK, tofu, kubectl, and the GKE auth plugin pre-installed.
Machines & network
1 VM · 4 vCPU · 10GiB RAM
Playground host Internet NAT MASQUERADE local (bridge) 172.16.0.0/24 gw 172.16.0.1/24eth0
VM
vCPU ·
eth0
/
oci://ghcr.io/omkar-shelke25/opentofu-gcloud-playground:sha-086f217
About

A disposable OpenTofu development environment with the gcloud SDK, OpenTofu CLI, kubectl, and the GKE auth plugin pre-installed. Full IDE support via VS Code. Runs on 4 vCPU / 10 GiB RAM / 100 GiB disk.

What's included

  • tofu: OpenTofu CLI 1.12.6
  • gcloud / gsutil / bq: Google Cloud SDK 585.0.0
  • kubectl: Kubernetes CLI
  • gke-gcloud-auth-plugin: GKE cluster auth
  • k9s / kubectx / kubens: cluster UI and context switching
  • lazygit: Git in a terminal UI
  • jq / yq: JSON and YAML processing
  • zsh with a Catppuccin starship prompt that shows the git branch, tofu workspace, GCP project and kube context, plus autosuggestions, syntax highlighting and atuin history search

Key commands

New project

mkdir my-infra && cd my-infra
tofu init

Plan and apply

tofu plan
tofu apply
tofu apply -auto-approve

Destroy

tofu destroy
tofu destroy -auto-approve

Format and validate

tofu fmt
tofu fmt -check
tofu validate

State management

tofu state list
tofu state show <resource>
tofu state rm <resource>
tofu import <resource> <id>

Workspaces

tofu workspace list
tofu workspace new dev
tofu workspace select dev

gcloud auth

gcloud auth login --no-launch-browser
gcloud auth application-default login --no-launch-browser
gcloud config set project PROJECT_ID

GKE access

gcloud container clusters get-credentials CLUSTER --location LOCATION
kubectl get nodes

Terminal shortcuts

k get pods      # kubectl
tf plan         # tofu
ll              # detailed file listing
z my-infra      # jump to a recent directory
lg              # lazygit
icons on        # Nerd Font icons, if your own terminal has the font

Ctrl+R searches history, Ctrl+T picks a file, Alt+C jumps into a subdirectory.

Every playground includes
Learn more about playgrounds
Start
Settings