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.
🎤 A Short Story from DevFest 2025
Section titled “🎤 A Short Story from DevFest 2025”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
terraformcommand 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.
How to Install Terraform (by OS)
Section titled “How to Install Terraform (by OS)”Windows (Most Critical)
Section titled “Windows (Most Critical)”Recommended: use Chocolatey
1. Install Chocolatey (if not installed)
Section titled “1. Install Chocolatey (if not installed)”Open PowerShell (Run as Administrator):
Set-ExecutionPolicy Bypass -Scope Process -Forceirm https://community.chocolatey.org/install.ps1 | iexRestart PowerShell after installation.
2. Install Terraform
Section titled “2. Install Terraform”choco install terraform -y3. Verify
Section titled “3. Verify”terraform versionwhere 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:
brew tap hashicorp/tapbrew install hashicorp/tap/terraformVerify:
terraform versionwhich terraformLinux (Ubuntu / Debian)
Section titled “Linux (Ubuntu / Debian)”sudo apt updatesudo 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 updatesudo apt install terraformVerify:
terraform versionwhich terraformLinux (RHEL / Rocky / Alma)
Section titled “Linux (RHEL / Rocky / Alma)”sudo dnf install -y dnf-plugins-coresudo dnf config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.reposudo dnf install terraform✅ Mandatory Pre-Workshop Checklist
Section titled “✅ Mandatory Pre-Workshop Checklist”- Terraform is installed
terraform versionruns without errors- PATH is correctly configured
- You have run
terraform initat least once
If this checklist is completed, 90% of Terraform workshop problems usually disappear.
Personal Notes (Lessons Learned)
Section titled “Personal Notes (Lessons Learned)”💡 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.
Closing
Section titled “Closing”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)