DEV Community

Manikanta Yarramsetti
Manikanta Yarramsetti

Posted on

Terraform Saved Me Hours Every Week — Here's What It Actually Does

Before Terraform, my routine was open AWS console, click here, create EC2,
set up security groups, configure VPC… and if something breaks, do it all
over again. It was really painful.

Someone in my team said "just use Terraform bro." I ignored it for weeks.
Big mistake.

So what is Terraform?

It is an Infrastructure as Code tool. Sounds fancy but basically you write
what you want in a .tf file, run a few commands, and your entire cloud
setup is ready. That's it.

What I liked about it

Write once and use anywhere. Same config works on AWS, Azure, GCP. No
rewriting everything again and again.

It remembers what it created. Terraform keeps a state file so it knows
what already exists and won't create duplicates. Pretty smart honestly.

Team friendly too. Just push your .tf files to Git and your whole team
knows what's going on. No more "who created that EC2 and why."

The commands I use daily

terraform init     
terraform plan     
terraform apply    
Enter fullscreen mode Exit fullscreen mode

init sets everything up, plan shows what will be created, apply actually
creates it. That's all you need to get started.

Quick example

Want to create an EC2 on AWS? This is all you write:

provider "aws" {
  region = "us-east-1"
}

resource "aws_instance" "my_server" {
  ami           = "ami-0c55b159cbfafe1f0"
  instance_type = "t3.micro"

  tags = {
    Name = "MyFirstServer"
  }
}
Enter fullscreen mode Exit fullscreen mode

Run terraform apply and your server is live. No console, no clicking around.

The honest downsides

The state file can cause problems when working in a team. Best to store it
in S3. Also the learning curve is real, you need to understand cloud basics
first. And everything is code, there is no GUI at all.

That's it

Once it clicks you won't go back to the AWS console. Your infrastructure
becomes code you can version, share and reuse.

If you haven't tried it just start with something small today. You'll
get it faster than you think.


Got questions or want me to cover modules or workspaces next?
Drop a comment below.

Top comments (0)