DEV Community

Cover image for 🚀 Terraform Day 3: Creating My First AWS Resource with Terraform (S3 Bucket)
Jeeva
Jeeva

Posted on

🚀 Terraform Day 3: Creating My First AWS Resource with Terraform (S3 Bucket)

“Infrastructure becomes real when code creates something in the cloud.”

Day 3 was the most exciting day so far in my Terraform journey.

Until now, Terraform was just concepts, providers, and commands.
Today, I built real cloud infrastructure using code — an AWS S3 bucket.
This was my first full Terraform workflow:

Write code
Initialize
Plan
Apply
Modify
Destroy
And seeing AWS respond to my code felt powerful.

🎯 Objective of Day 3
The goal today was simple but meaningful:
✅ Learn how to provision AWS resources using Terraform
✅ Practice Terraform command workflow
✅ Understand how Terraform tracks infrastructure
✅ Learn safe deployment and deletion
✅ Build confidence working with real cloud services

🛠️ Writing the Terraform Code
I started by creating a configuration file (main.tf):
Provider Configuration
provider "aws" {
region = "us-east-1"
}
S3 Resource Configuration
resource "aws_s3_bucket" "demo" {
bucket = "my-terraform-first-bucket-1234"

tags = {
Name = "Terraform S3 Bucket"
}
}
⚠ S3 bucket names must be globally unique.

⚙️ Terraform in Action

Terraform follows a simple but powerful workflow.

Step 1: Initialize
terraform init
Downloads providers and sets up your project.

Step 2: Plan
terraform plan
Shows what will change before anything breaks.

Step 3: Apply
terraform apply
Creates actual cloud resources.
Terraform showed my S3 bucket in AWS — created in seconds ✅

🧩 Updating Infrastructure
I updated tags in the configuration and ran:
terraform plan
terraform apply
Terraform:
✅ Detected change
✅ Modified resource
✅ Updated state file
No recreation. Only updates.

💣 Destroying Everything
Then came:
terraform destroy
Terraform:
✅ Identified managed resources
✅ Deleted safely
✅ Left nothing behind

Clean infrastructure, zero cost risk.
🔐 AWS Authentication
Before running Terraform:
aws configure
Terraform uses credentials from:
AWS CLI
Environment variables
IAM roles
No credentials = No cloud access.

🧠 Key Lessons from Day 3
Terraform manages full lifecycle
State tracks reality
Plan prevents mistakes
Code controls cloud
Destroy is safe and simple
Docs > autocomplete

🏁 Conclusion
This day changed how I see infrastructure.
Terraform didn’t just describe resources —
It created them.
And then it removed them just as cleanly.

Tomorrow: Even deeper into Terraform's core 🚀

Top comments (0)