Skip to content

From Code to Automated Web Infrastructure on Google Cloud with Terraform

This article was born from real experience as a speaker at GDG Bogor DevFest 2025, where a Terraform session almost ran out of time due to one simple issue: tool installation.

At GDG Bogor DevFest 2025, I delivered a session titled:

“From Code to Automated Web Infrastructure on Google Cloud with Terraform”

The goal was straightforward:

  • Help participants understand Infrastructure as Code
  • Continue with hands-on provisioning of web infrastructure on GCP

But reality hit hard:

  • Participants used different operating systems (Windows, macOS, Linux)
  • I was using macOS myself
  • Many had never installed Terraform before

Problems quickly appeared:

  • Terraform wasn’t installed
  • the terraform command wasn’t recognized
  • PATH issues (especially on Windows)
  • PowerShell, CMD, and Git Bash added extra confusion

In the end:

30–40 minutes of the session were spent just installing Terraform.

That’s when I realized: Tooling setup is not a trivial detail — it’s a single point of failure for workshops.

That’s why this article exists: a pre-workshop survival guide.


Why Terraform Installation Must Be Done First

Section titled “Why Terraform Installation Must Be Done First”

Terraform is a CLI tool.
If the CLI doesn’t work:

  • The workshop can’t move forward
  • Speakers panic
  • Participants get confused
  • Valuable time is wasted

There’s only one solution:

Make sure the setup is done before the event.


Recommended: use Chocolatey

Open PowerShell (Run as Administrator):

Terminal window
Set-ExecutionPolicy Bypass -Scope Process -Force
irm https://community.chocolatey.org/install.ps1 | iex

Restart PowerShell after installation.

Terminal window
choco install terraform -y
Terminal window
terraform version
where terraform

⚠️ Common issues on Windows

  • Terraform is installed but the command isn’t recognized
  • Root cause: PATH not refreshed
  • Solution: restart PowerShell / Windows Terminal (sometimes a full reboot)

Using Homebrew:

Terminal window
brew tap hashicorp/tap
brew install hashicorp/tap/terraform

Verify:

Terminal window
terraform version
which terraform

Terminal window
sudo apt update
sudo apt install -y gnupg software-properties-common curl
curl -fsSL https://apt.releases.hashicorp.com/gpg | \
sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \
https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \
sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update
sudo apt install terraform

Verify:

Terminal window
terraform version
which terraform

Terminal window
sudo dnf install -y dnf-plugins-core
sudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
sudo dnf install terraform

  1. Terraform is installed
  2. terraform version runs without errors
  3. PATH is correctly configured
  4. You have run terraform init at least once

If this checklist is completed, 90% of Terraform workshop problems usually disappear.


💡 Lessons learned from DevFest

  • Never install tools on the event day
  • Send installation guides at least one day before
  • Ask participants to test terraform version
  • It’s better to cut content than lose time on setup

Automation is powerful,
but it only feels powerful when the tools are ready to use.


Terraform allows us to:

  • Define infrastructure as code
  • Create repeatable environments
  • Reduce “works on my machine” issues

But before getting to the fun part,

Make sure one simple thing works: Terraform itself.


🔜 Part 2:
From Code to Automated Web Infrastructure on Google Cloud with Terraform
(a deep dive into Terraform code until the infrastructure is fully deployed)