Skip to content
nareshsajwaniPublic

About

πŸš€ Terraform learning diary by an Oracle DBA. Day-by-day notes, all beginner mistakes & fixes, working AWS Free Tier scripts, and a 2-month roadmap to HashiCorp Terraform Associate certification.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Terraform Learning Journey

From Oracle DBA to Cloud DevOps/DBRE β€” Day-by-Day Terraform Notes
Author: Naresh Sajwani | Goal: HashiCorp Terraform Associate (003) Certification
Environment: RHEL VM (VirtualBox) + AWS Free Tier


πŸ“Œ Repository Description

A real-world, mistake-documented Terraform learning diary. 
Covers installation, first EC2 deployment, all beginner blunders, 
and how to fix them. Built by an Oracle DBA for other newbies.

🎯 What This Repo Is

This is NOT a polished tutorial written by an expert. This is a raw learning diary written by someone who broke things, got confused, fixed them, and wrote it all down.

If you're an Oracle DBA (or any IT professional) trying to learn Terraform from zero, you'll find every mistake I made here β€” so you don't have to make them yourself.


πŸš€ Quick Start β€” Run Your First Terraform Script

Prerequisites

  • RHEL/CentOS VM (or any Linux)
  • AWS Free Tier account
  • AWS Access Key & Secret Key

🧠 Key Concepts Explained Simply

The "Dot" Notation: aws_vpc.my_vpc.id

aws_vpc     .    my_vpc     .     id
   ↑              ↑                ↑
  Type         Name            Attribute
(What?)       (Which?)        (What detail?)

Oracle Analogy:

  • resource "aws_vpc" "my_vpc" = INSERT INTO vpc_table (name, cidr) VALUES ('my_vpc', '10.0.0.0/16')
  • aws_vpc.my_vpc.id = SELECT id FROM vpc_table WHERE name = 'my_vpc'

Terraform does the "SELECT" automatically.

Implicit Dependency

resource "aws_subnet" "my_subnet" {
  vpc_id = aws_vpc.my_vpc.id  # Terraform sees this and creates VPC FIRST
}

Terraform is smart. It sees the reference and knows the order.

State File = Terraform's Memory

File Purpose
terraform.tfstate Terraform's notebook β€” remembers everything it created
terraform.tfstate.backup Backup before last change
terraform.tfstate.1234567890.backup Backup before state rm or import

Golden Rule: Never delete terraform.tfstate. The .backup files are safe to clean up.


πŸ“‹ Terraform Command Cheat Sheet

Command What It Does When to Use
terraform init Download plugins First time only per project
terraform fmt Auto-format code Before every commit
terraform validate Check syntax Before plan
terraform plan Dry run / preview Before every apply
terraform apply Create/Update resources When plan looks good
terraform apply -auto-approve Apply without confirmation Scripts/CI only
terraform plan -out=file.tfplan Save plan to file For locked/safe applies
terraform apply file.tfplan Apply saved plan Ignores code changes
terraform destroy Delete everything When done practicing
terraform show Show current state To see what Terraform knows
terraform state list List managed resources Check what's tracked
terraform state rm <resource> Remove from state (not AWS) When Terraform should forget
terraform import <resource> <id> Bring existing resource under management For resources created manually
terraform refresh Sync state with AWS reality After manual console changes

πŸ”— Useful Resources


🀝 Contributing

This is a personal learning repo, but if you spot errors or have suggestions, feel free to open an issue or PR!

About

πŸš€ Terraform learning diary by an Oracle DBA. Day-by-day notes, all beginner mistakes & fixes, working AWS Free Tier scripts, and a 2-month roadmap to HashiCorp Terraform Associate certification.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors