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

Published: (December 10, 2025 at 12:44 AM EST)
2 min read
Source: Dev.to

Source: Dev.to

Cover image for 🚀 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:

  1. Write code
  2. Initialize
  3. Plan
  4. Apply
  5. Modify
  6. Destroy

Seeing AWS respond to my code felt powerful.

🎯 Objective of Day 3

  • ✅ 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

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 the full lifecycle.
  • State tracks reality.
  • plan prevents mistakes.
  • Code controls the cloud.
  • destroy is safe and simple.
  • Documentation > 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 🚀

Back to Blog

Related posts

Read more »

AWS Terraform Lifecycle Rules

Introduction Infrastructure as Code IaC is most powerful when you have full control over how resources behave during updates, replacements, and deletions. Terr...

Day 8 - Terraform Meta-Arguments

Whenever we create any resource using Terraform—whether it is an S3 bucket, an EC2 instance, or a security group—we have to pass certain arguments that are spec...

Terraform Data Source (AWS)

What Are Terraform Data Sources? A data source in Terraform is a read‑only lookup to an existing resource. Instead of creating something new, Terraform queries...