Terraform Associate Certification Prep
Infrastructure as Code
The Old Way: Manual Setups
Imagine you're setting up a new server for a website. In the past, this was a very hands-on job. An IT administrator would physically get a machine, or log into a virtual one, and start clicking through menus. They would install the operating system, configure the network settings, set up the web server software, and adjust security rules. It was all done manually, step by step.
This manual approach works for one server. But what happens when you need ten? Or a hundred? Each one has to be configured by hand. It's slow, tedious, and prone to human error. One person might forget a security update. Another might set a memory limit slightly differently. These small inconsistencies, known as "configuration drift," can cause big problems that are difficult to track down.
A New Blueprint: Infrastructure as Code
Infrastructure as Code (IaC) completely changes this process. Instead of manually configuring servers, networks, and databases, you define them in configuration files. These files are human-readable and act as a blueprint for your entire system.
Infrastructure as Code (IaC) is like creating a recipe for setting up a computer system.
Think of it like a recipe for baking a cake. The recipe lists all the ingredients (servers, databases, load balancers) and the exact steps to combine them. Anyone can follow the recipe and get the same delicious cake every time. With IaC, anyone can run the configuration file and get the exact same infrastructure, every time. An IaC tool reads this file and automatically builds, or provisions, the environment you described.
Provisioning
verb
The process of setting up IT infrastructure. It can also refer to the steps required to manage access to data and resources, and make them available to users and systems.
This is a simple example of what an IaC file might look like. It describes a virtual server instance, specifying its size and the operating system image to use. You don't need to understand the details yet, just the core idea: infrastructure is defined in a text file.
resource "aws_instance" "web_server" {
ami = "ami-0c55b159cbfafe1f0" # Amazon Linux 2 AMI
instance_type = "t2.micro" # A small, free-tier eligible size
tags = {
Name = "ExampleWebServer"
}
}
The Benefits of IaC
This code-based approach brings huge advantages over the traditional manual method.
| Benefit | Traditional Management | Infrastructure as Code |
|---|---|---|
| Consistency | Prone to human error and configuration drift. | Every environment is identical, built from the same blueprint. |
| Scalability | Slow and manual. Adding 100 servers takes 100x the effort. | Effortless. Define one server, then easily deploy hundreds. |
| Version Control | No history. Changes are hard to track or undo. | All changes are saved in version control (like Git). You can see who changed what, why, and easily roll back to a previous version. |
| Speed | Slow. Provisioning can take hours or days. | Fast. Entire environments can be created in minutes. |
| Cost | High labor costs for manual setup and maintenance. | Lower costs due to automation and fewer errors. |
Because your infrastructure is now just code, you can apply the same tools and workflows that software developers use. You can use version control systems like Git to track every change. You can review changes before they are applied and collaborate with teammates. This brings a level of discipline and reliability that was impossible with manual setups.
By treating infrastructure as code, you create a single source of truth. The code file is the authoritative description of what your infrastructure should look like. There's no more guessing or digging through settings menus to figure out how a server was configured. The blueprint is right there for everyone to see. This is the foundation that tools like Terraform are built on.
Time to review what we've learned.
Let's check your understanding.
What is the core principle of Infrastructure as Code (IaC)?
"Configuration drift" is a problem often associated with manual server setup. What does it refer to?
Now that you understand the 'why' behind IaC, you're ready to learn about the tools that make it possible.

