From Manual Infrastructure to Infrastructure as Code: My First Steps with Terraform on AWS
DevOps / Cloud Infrastructure
From Manual Infrastructure to Infrastructure as Code: My First Steps with Terraform on AWS
As I started learning more about Cloud Computing and DevOps, I realized that creating infrastructure manually through the AWS Console is useful for understanding the platform, but it doesn't scale very well.
That's where Infrastructure as Code (IaC) comes in.
In this article, I'll share my first steps using Terraform to provision infrastructure on AWS, what I learned during the process, and why IaC is becoming an essential skill for anyone interested in Cloud and DevOps.
What is Infrastructure as Code?
Infrastructure as Code is the practice of managing infrastructure through configuration files instead of creating and configuring resources manually.
Instead of clicking through the AWS Console every time I need a resource, I can describe the desired infrastructure in code and let Terraform create it.
This provides several benefits:
- Repeatable infrastructure
- Version control
- Easier collaboration
- Automation
- More consistent environments
- Easier infrastructure changes
For me, one of the biggest advantages is being able to keep infrastructure configurations alongside my application code in Git.
Why Terraform?
Terraform is an Infrastructure as Code tool that allows us to define infrastructure using configuration files.
It also supports multiple cloud providers, but in this project I used Terraform with AWS.
The basic Terraform workflow is:
terraform init ↓terraform plan ↓terraform apply ↓Infrastructure created ↓terraform destroy
1. Terraform Init
The first step is initializing the project:
terraform init
This downloads the required provider and prepares the Terraform working directory.
2. Terraform Plan
Before creating anything, I can preview the changes:
terraform plan
This is particularly useful because it allows me to review what Terraform intends to create, modify, or remove.
3. Terraform Apply
Once everything looks correct:
terraform apply
Terraform then communicates with AWS and creates the resources described in the configuration.
4. Terraform Destroy
When the infrastructure is no longer needed:
terraform destroy
This removes the resources managed by Terraform.
For learning projects, this is especially useful because I can create an environment, experiment with it, and then clean everything up when I'm finished.
My Learning Project
For my first experiments, I focused on understanding the relationship between Terraform and AWS rather than building a huge architecture.
The goal was simple:
Define → Provision → Test → Destroy
This helped me understand an important concept: Terraform isn't just a tool for creating resources. It allows us to define the desired state of our infrastructure.
That changes the way we think about cloud environments.
Instead of asking:
"What resources do I need to click and configure?"
I can start asking:
"What should the final state of my infrastructure look like?"
Terraform State
One of the concepts that initially required more attention was Terraform state.
Terraform uses a state file to keep track of the infrastructure it manages.
For individual experiments, a local state file can be enough. However, when working with teams or CI/CD pipelines, storing state remotely becomes much more important.
For AWS projects, an Amazon S3 backend can be used to store Terraform state remotely.
This is something I plan to explore further as I continue improving my infrastructure projects.
What I Learned
The most important lesson wasn't simply learning Terraform commands.
It was understanding how Cloud, Infrastructure as Code, Git, and automation connect together.
A typical DevOps workflow can look like:
Developer ↓Git Repository ↓CI/CD Pipeline ↓Terraform ↓AWS Infrastructure
This is one of the areas of Cloud Computing that interests me the most.
Terraform can become the foundation for automating infrastructure, while CI/CD tools can automate the process of validating and deploying those changes.
What's Next?
My next goal is to move beyond simple Terraform configurations and start working with more realistic architectures.
Some things I want to explore are:
- Terraform modules
- Remote state with S3
- State locking
- AWS VPC architecture
- IAM and least-privilege permissions
- GitHub Actions
- Terraform CI/CD
- Docker and AWS
- Kubernetes and Amazon EKS
I'm especially interested in understanding how these technologies can work together to create reliable and automated cloud environments.
Final Thoughts
Learning Cloud Computing can feel overwhelming because there are so many services and technologies to understand.
Terraform helped me realize that I don't need to learn everything at once.
I can start with one resource, understand how it works, automate it, and then gradually increase the complexity.
My biggest takeaway so far is:
Don't just learn the cloud. Build with it.
Every project gives me another opportunity to understand how infrastructure, automation, and software development fit together.
I'm still learning, but that's exactly what makes the journey interesting.
What is your favorite Infrastructure as Code tool or AWS service to build with?
I'd love to hear what other builders are working on.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article