DEV Community

Cover image for Breaking Free from "Click-Ops" with Terraform
Gerlie Ann Katherine Daga-as
Gerlie Ann Katherine Daga-as

Posted on

Breaking Free from "Click-Ops" with Terraform

Today marks the beginning of my #30daysofawsterraform challenge! I spent Day 01 diving into the fundamentals of Infrastructure as Code (IaC) with Piyush Sachdeva.

If you've ever spent hours clicking through the AWS Console only to realize you made a typo in a security group, this journey is for you.

📺 Reference Video

🏗️ What is Infrastructure as Code (IaC)?

In simple terms, IaC is the process of managing and provisioning your technology stack through software (code) rather than manual hardware configuration or interactive configuration tools.

Why do we need it?

Piyush explained a scenario that really hit home: The Scalability Trap.
Manual Setup: Provisioning a 3-tier app (Web, App, DB) takes ~2 hours.
The Problem: In an enterprise, you need multiple environments (Dev, SIT, QA, Prod).
The Math: 2 hours x 6 environments = 12 hours of manual clicking!

🔑 Key Takeaways from Day 01

Eliminating Configuration Drift: Manual setups lead to "it works in Dev but not in Prod." Terraform ensures every environment is an exact replica of the code.

The Power of Git: Because infrastructure is code, we can store it in GitHub. This gives us a history of every change made to our cloud.

Speed: With one command, we can spin up or destroy entire environments. This is a lifesaver for saving costs on non-prod environments.

🐧 My Linux Setup

Since I am using a Linux machine for this challenge, I spent today getting my environment ready. Here is how I set up Terraform:

  1. Installation (Ubuntu/Debian) I followed the official HashiCorp steps to add the repository and install the CLI:
# Install dependencies
sudo apt-get update && sudo apt-get install -y gnupg software-properties-common

# Add HashiCorp GPG key
wget -O- https://apt.releases.hashicorp.com/gpg | \
gpg --dearmor | \
sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg

# Add the repository
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

# Install Terraform
sudo apt-get update && sudo apt-get install terraform
Enter fullscreen mode Exit fullscreen mode
  1. Verification To make sure everything was correct, I ran:
terraform -version
Enter fullscreen mode Exit fullscreen mode
  1. Productivity Hack: Alias A great tip for Linux users—adding an alias to save time:
alias tf='terraform'
# Now I can just type 'tf init' instead of the full word!
Enter fullscreen mode Exit fullscreen mode

terraform version

⚙️ The Terraform Workflow

I learned that Terraform doesn't just "do it." It follows a logical path:

tf init: Initializes the working directory and downloads providers.
tf plan: The "Preview" mode. It shows you what will happen before you commit.
tf apply: Executes the code and creates the resources in AWS.
tf destroy: Cleans up everything to avoid unnecessary AWS bills.

Final Thoughts

Day 01 was all about the "Why." Understanding that Terraform is a tool for reliability and consistency is the foundation for everything else we will learn. I'm ready for Day 02!

Let's Connect!

If you're also taking the #30daysofawsterraform challenge, let's connect!
LinkedIn: Profile link

Top comments (0)