DEV Community

Cover image for ๐Ÿš€ Terraform Day 3: Creating My First AWS Resource with Terraform (S3 Bucket)
Jeeva
Jeeva

Posted on • Edited 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)