How to provision and S3 storage with Terraform: Plan, check, Apply, approve

The four-step or should I say, two-step ritual every engineer configuring infrastructure eventually lives by.

In my previous posts, we explored what Terraform is, why it matters, its components, how to install it, and how to prepare it for real use.
N…


This content originally appeared on DEV Community and was authored by Emmanuel E. Ebenezer

The four-step or should I say, two-step ritual every engineer configuring infrastructure eventually lives by.

In my previous posts, we explored what Terraform is, why it matters, its components, how to install it, and how to prepare it for real use.
Now it’s time to actually use it. Today, we’ll be provisioning an object storage bucket on AWS — using code.

If you haven’t been following from the start, here are some helpful resources to get you up to speed (assuming you use a Linux system):
What is terraform
Install terraform
Get started with Terraform on AWS

Alright, let's dive in.
A quick overview of what we would be doing today.

How to provision an S3 on AWS with Terraform

First, create a folder and your Terraform configuration file.

mkdir tf-practice
cd tf-practice
touch main.tf

Before you go on, be sure to have aws credentials that would have access to the s3 resource.
Open main.tf with your favourite editor and paste this configuration.
Feel free to customise it using the documentation: S3 resource documentation.

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

}
provider "aws" {
    region = "eu-west-2"
    # profile = "<leave commented if you have only one aws profile>"
}
resource "aws_s3_bucket" "demo-resource-creation" {
  bucket = "<use a name you know nobody else would>"
  force_destroy = true

  tags = {
    Name        = "My bucket"
    Environment = "Demo"
  }
}

Now we create the resources.
Make sure you’re still in the folder we created (tf-practice) and you’ve installed Terraform properly.Then use the following commands to perform the infrastructure magic lol.

terraform plan
terraform apply

Approve the changes and…
Ta-daa! You’ve just provisioned an S3 bucket on AWS using code.

Here’s something fun to try: update the tags to see how Terraform tracks and manages resource changes.

resource "aws_s3_bucket" "demo-resource-creation" {
  bucket = "<use a name you know nobody else would>"
  force_destroy = true

  tags = {
    Name        = "My bucket 2.0"
    Environment = "New Demo"
  }
}

Run terraform apply again and check the AWS console, your updated tags should appear.
That still feels magical to me.

Now what do these commands do.

Terraform plan : A dry-run, it shows what Terraform will create, change, or destroy before it touches or changes anything.

Terraform apply: This is the command that tells Terraform to call the AWS API and actually create or update your resources.

And of course, my favourite command:

terraform destroy
It removes everything Terraform created, super helpful for cleaning up and avoiding unnecessary cloud bills.

When you are satisfied with the newly ingested IaC wisdom, run terraform destroy to destroy our practice s3 bucket.

Terraform plan : A dry-run.It shows what Terraform will create, change, or destroy before it touches or changes anything.

Terraform apply: This is the command that tells Terraform to call the AWS API and actually create or update your resources.

And of course, my favourite command Terraform destroy.
It removes everything Terraform created, super helpful for cleaning up and avoiding unnecessary cloud bills.

When you are satisfied with the newly ingested IaC wisdom, run terraform destroy to destroy our practice s3 bucket.

Learning this was genuinely exciting, and sharing it feels even better.
When I think about how software blends with infrastructure, and the kinds of tools I'd to build for cloud operations someday, understanding this flow helps shape my wild imaginations.

Hey, I'm upskilling with Piyush and the CloudOps Community on discord.

Thank you for reading and see ya tomorrow.


This content originally appeared on DEV Community and was authored by Emmanuel E. Ebenezer


Print Share Comment Cite Upload Translate Updates
APA

Emmanuel E. Ebenezer | Sciencx (2025-11-27T10:52:27+00:00) How to provision and S3 storage with Terraform: Plan, check, Apply, approve. Retrieved from https://www.scien.cx/2025/11/27/how-to-provision-and-s3-storage-with-terraform-plan-check-apply-approve/

MLA
" » How to provision and S3 storage with Terraform: Plan, check, Apply, approve." Emmanuel E. Ebenezer | Sciencx - Thursday November 27, 2025, https://www.scien.cx/2025/11/27/how-to-provision-and-s3-storage-with-terraform-plan-check-apply-approve/
HARVARD
Emmanuel E. Ebenezer | Sciencx Thursday November 27, 2025 » How to provision and S3 storage with Terraform: Plan, check, Apply, approve., viewed ,<https://www.scien.cx/2025/11/27/how-to-provision-and-s3-storage-with-terraform-plan-check-apply-approve/>
VANCOUVER
Emmanuel E. Ebenezer | Sciencx - » How to provision and S3 storage with Terraform: Plan, check, Apply, approve. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/11/27/how-to-provision-and-s3-storage-with-terraform-plan-check-apply-approve/
CHICAGO
" » How to provision and S3 storage with Terraform: Plan, check, Apply, approve." Emmanuel E. Ebenezer | Sciencx - Accessed . https://www.scien.cx/2025/11/27/how-to-provision-and-s3-storage-with-terraform-plan-check-apply-approve/
IEEE
" » How to provision and S3 storage with Terraform: Plan, check, Apply, approve." Emmanuel E. Ebenezer | Sciencx [Online]. Available: https://www.scien.cx/2025/11/27/how-to-provision-and-s3-storage-with-terraform-plan-check-apply-approve/. [Accessed: ]
rf:citation
» How to provision and S3 storage with Terraform: Plan, check, Apply, approve | Emmanuel E. Ebenezer | Sciencx | https://www.scien.cx/2025/11/27/how-to-provision-and-s3-storage-with-terraform-plan-check-apply-approve/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.