DEV Community

Cover image for Creating My First S3 Bucket with Terraform.
Zakariyau Mukhtar
Zakariyau Mukhtar

Posted on

Creating My First S3 Bucket with Terraform.

Today marks Day 3 of my 30 Days of AWS Terraform Challenge, and it was the day things started feeling real. Instead of just reading about providers, blocks, and installation steps, I finally deployed an actual AWS resource using Terraform: an S3 bucket. It was a simple task, but seeing infrastructure appear from code felt like a solid step forward.

Setting up the project inside IntelliJ

Since I’m working on Windows 11, my setup process is different from the typical Linux workflow. I use IntelliJ IDEA, which makes everything neater and easier to manage.

Here’s how I prepared my workspace:

  1. Opened IntelliJ
  2. Right-clicked the project explorer → New → Directory
  3. Named the folder day 03
  4. Inside it, I created a new file:main.tf

IntelliJ automatically formatted the Terraform file and handled indentation, which makes it a comfortable environment for IaC.

My exact Terraform configuration

Once the folder was ready, I wrote the configuration for the S3 bucket.

This is exactly what’s in my IntelliJ project:

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 6.0"
    }
  }
}

# Configure the AWS Provider
provider "aws" {
  region = "us-east-1"
}

# Create S3 bucket
resource "aws_s3_bucket" "first_bucket" {
  bucket = "devopswithzacks-bucket-001"

  tags = {
    Name        = "My bucket 2.0"
    Environment = "Dev"
  }
}
Enter fullscreen mode Exit fullscreen mode

A quick breakdown:

  • terraform block → defines the AWS provider and version.
  • provider block → tells Terraform to use AWS in the us-east-1 region.
  • resource block → creates the S3 bucket with my custom name and tags.

What I liked most is how readable Terraform configurations are you can literally see what is going to be created.

Running Terraform commands from Windows

With everything in place, I opened the terminal (inside IntelliJ) and started the deployment process.

1. terraform plan

terraform plan
Enter fullscreen mode Exit fullscreen mode

This showed me a summary of what Terraform wanted to create:
1 resource to add good sign.

2. terraform apply

terraform apply -auto-approve
Enter fullscreen mode Exit fullscreen mode

Terraform displayed the planned changes again. After typing , the S3 bucket was provisioned.

I switched to the AWS console and seeing devopswithzacks-bucket-001 sitting there felt great. Even though it’s a small resource, the idea of controlling infrastructure from code is powerful.

Testing changes with Terraform
To see how Terraform responds to updates, I modified the tags:
tags = {
Name = "My bucket 1.0"
Environment = "Dev"
}

Then I ran:

terraform apply -auto-approve

Instead of recreating the bucket, Terraform simply updated its tags.
Watching Terraform detect and apply only the necessary changes helped me understand the declarative nature of IaC.

Useful commands from today
terraform plan:
Dry-run preview of changes.
Great for checking mistakes before they hit your cloud account.

terraform apply:
Runs the actual creation/update of resources.

terraform destroy:
Deletes everything created by Terraform.
This is key for preventing unnecessary AWS charges, especially during learning.

Today’s session felt straightforward, especially since IntelliJ keeps everything organized. Writing the configuration, running the commands, and verifying the bucket in AWS gave me a concrete taste of Infrastructure-as-Code in action. I can already tell that this workflow is going to be very powerful as I move into more complex AWS resources later in the challenge.

One small S3 bucket, but a big step in understanding how cloud automation actually works.

Top comments (0)