Today marks the start of my #30daysofAWSTerraform challenge! π Before writing code, I focused on understanding why we need Infrastructure as Code (IaC) and setting up a robust development environment.
We often underestimate the pain of manual clicking in the AWS Consoleβuntil we have to replicate an environment for Production and everything breaks. Terraform solves this by treating infrastructure as software.
ποΈ What is Terraform?
Terraform is an open-source Infrastructure as Code (IaC) tool created by HashiCorp. It allows you to define and provision data center infrastructure using a high-level configuration language called HCL (HashiCorp Configuration Language).
Think of it as a blueprint for your cloud. Instead of manually clicking through the AWS console to create servers, databases, and networks, you write code that describes what you want, and Terraform makes it happen.
π Core Purpose
Provisioning: Build infrastructure from scratch (e.g., AWS EC2, VPC, S3).
Management: Update and version control your infrastructure just like application code.
Cloud-Agnostic: Works with AWS, Azure, Google Cloud, Kubernetes, and hundreds of other providers.
π‘ Why Do We Need It? (The "Why")
Before Terraform, managing infrastructure was painful:
Manual Clicking: "ClickOps" is slow, tedious, and prone to human error.
Inconsistency: "It works on my machine" issues because Dev and Prod environments drifted apart.
No History: Hard to track who changed what and when.
Terraform solves this by:
Automation: Spin up entire environments in minutes.
Consistency: The same code creates the exact same infrastructure every time.
Version Control: Track changes in Git/GitHub.
π οΈ Installation Guide
To get started, you need to install the Terraform CLI on your local machine.
For Windows
Download the binary from the official website. url: https://developer.hashicorp.com/terraform/install#windows --> Extract the .zip file --> Add the folder containing terraform.exe to your system's PATH environment variable --> Verify: Open PowerShell and run: terraform -version
β
Tasks Completed:
Mastered IaC Concepts: Learned how Terraform solves the "It works on my machine" problem by ensuring consistency across Dev, Staging, and Prod.
Tooling Setup: Successfully installed Terraform CLI and verified the version.
Workflow Optimisation: Set up shell aliases (tf=terraform) and autocompletion to save time on future commands.
IDE Setup: Configured VS Code with the HashiCorp extension for better syntax support.
π Notes:
The Problem: Manual infrastructure takes hours/days and is prone to human error.
The Solution: Terraform interacts with Cloud APIs (like AWS) to provision resources automatically using HCL (HashiCorp Configuration Language).
Core Workflow: Write -> Plan (Dry Run) -> Apply (Create) -> Destroy (Clean up).
π Resources:
My Code & Progress: https://github.com/Gokulprasath-N/Terraform-Full-Course-Aws
Video I watched: https://www.youtube.com/watch?v=xUtGqC-NXJE
I am excited to start writing actual HCL code tomorrow!
Top comments (0)