AWS Builder Center
From Manual to Automated: Getting Started with Terraform on AWS

From Manual to Automated: Getting Started with Terraform on AWS

Explore Infrastructure as Code with Terraform and learn how AWS infrastructure can be defined, version-controlled, reviewed, and managed through automation.

Series: From Code to Cloud: My DevOps Journey on AWS (5 articles)

  1. …
  2. 4
    From Manual to Automated: Getting Started with Terraform on AWS This article

From Manual to Automated: Getting Started with Terraform on AWS

Introduction

As I continued learning AWS and DevOps, I noticed something important.
Creating AWS resources manually through the console is useful when learning, but it becomes difficult to manage when an environment grows.
What if I could describe my infrastructure in code and let a tool create it for me?
This is where Infrastructure as Code (IaC) comes in.
In this article, I'll explore the basics of Infrastructure as Code and how Terraform can be used to manage AWS infrastructure.

What Is Infrastructure as Code?

Infrastructure as Code is the practice of managing infrastructure through configuration files instead of creating and configuring everything manually.
Instead of repeatedly clicking through the AWS Console, we describe what we want our infrastructure to look like.
The basic idea is:
Infrastructure → Code → Automation
For example, instead of manually creating a network, server, and security configuration, we can describe those resources in Terraform configuration.
Terraform can then compare the desired configuration with the current infrastructure and determine what changes are required.

Why Does IaC Matter in DevOps?

Infrastructure is an important part of the application delivery process.
If an application requires a specific environment, manually recreating that environment can take time and introduce mistakes.
Infrastructure as Code helps make infrastructure:
  • Repeatable
  • Consistent
  • Version-controlled
  • Reviewable
  • Automatable
This changes the way infrastructure is managed.
Instead of infrastructure being something configured manually, it becomes something that can be treated similarly to application code.

What Is Terraform?

Terraform is an Infrastructure as Code tool that allows us to define and manage infrastructure using configuration files.
Terraform supports many cloud providers, including AWS.
A simplified Terraform workflow looks like this:
Write Configuration
↓
Review Changes
↓
Create or Update Infrastructure
↓
Manage Infrastructure as Code
Terraform uses these configuration files to understand what infrastructure we want.

Terraform and AWS

Terraform can interact with AWS to create and manage many different types of resources.
For example, Terraform can be used to manage:
  • VPCs
  • Subnets
  • Security groups
  • EC2 instances
  • Load balancers
  • IAM resources
  • Databases
  • ECS resources
  • S3 buckets
This makes Terraform useful for managing infrastructure across an entire application environment.

Understanding the Terraform Workflow

One of the first Terraform concepts I wanted to understand was its workflow.
At a high level:
Write
↓
Define the desired infrastructure.
Plan
↓
Review what Terraform intends to change.
Apply
↓
Terraform creates or updates the infrastructure.
This workflow is useful because it allows us to review infrastructure changes before applying them.

Infrastructure Becomes Version Controlled

One of the biggest advantages of Infrastructure as Code is that infrastructure configuration can be stored in a Git repository.
This creates a workflow similar to application development:
Developer
↓
Change Infrastructure Code
↓
Git
↓
Review
↓
Apply Infrastructure Changes
Now infrastructure changes can have a history.
We can see who changed something, what was changed, and when it happened.
This is a major shift from manually configuring resources in the AWS Console.

Terraform and CI/CD

Terraform also fits naturally into the CI/CD concepts from my previous articles.
The workflow can eventually look like:
GitHub
↓
CI/CD Pipeline
↓
Terraform
↓
AWS Infrastructure
This means infrastructure changes can also become automated.
For example, a change to the infrastructure configuration could go through a review process before being applied.
This brings application automation and infrastructure automation closer together.

Terraform State

Another important concept in Terraform is state.
Terraform uses a state file to keep track of the infrastructure it manages.
The state helps Terraform understand the relationship between the configuration and the real resources that exist in AWS.
For team environments, managing state carefully becomes especially important.
This is one of the areas I want to explore further as I continue learning Terraform.

Manual Infrastructure vs Infrastructure as Code

The difference becomes clearer when comparing the two approaches.

Manual Approach

AWS Console
↓
Create resources manually
↓
Configure resources
↓
Repeat when needed

Infrastructure as Code

Terraform Configuration
↓
Review changes
↓
Apply configuration
↓
Infrastructure is created or updated
The second approach makes it easier to reproduce environments and manage changes systematically.

What I Learned

Learning about Terraform changed how I think about cloud infrastructure.
Previously, I mostly thought about AWS resources as things I create and configure.
With Infrastructure as Code, I started thinking about infrastructure as something that can also be designed, versioned, reviewed, and automated.
Some of the key concepts I learned are:
  • Infrastructure can be managed as code.
  • Terraform can manage AWS resources.
  • Infrastructure changes can be version-controlled.
  • Terraform provides a plan before applying changes.
  • IaC makes environments easier to reproduce.
  • Infrastructure can eventually become part of a CI/CD workflow.

Conclusion

Infrastructure as Code changes the way we think about cloud infrastructure.
Instead of treating infrastructure as something that must be configured manually, we can define it as code and manage it using familiar development practices such as version control and code review.
For someone learning DevOps, Terraform provides an excellent opportunity to understand this approach.
My next goal is to take what I've learned about Terraform and connect it with CI/CD automation, moving one step closer to a fully automated DevOps workflow.
Code → Build → Container → Deploy → Automate Infrastructure

Series: From Code to Cloud: My DevOps Journey on AWS (5 articles)

  1. …
  2. 4
    From Manual to Automated: Getting Started with Terraform on AWS This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article