Skip to content
IaCTerraformDevOps

What Is Infrastructure as Code (IaC)?

July 9, 2026 · 10 min read

Last verified: 2026-07-17

Frequently Asked Questions

What is Infrastructure as Code (IaC)?

Infrastructure as Code (IaC) is the approach of defining and managing your infrastructure (servers, networks, databases) with version-controlled code files instead of clicking around a cloud console. Whatever the code says, the infrastructure is. This makes infrastructure versionable, reviewable, and reproducible.

What are the problems with setting up infrastructure by hand?

Manual setup is not reproducible; you can't rebuild the same environment identically twice. It's also undocumented (no record of who changed what and why), error-prone due to human clicking, and doesn't scale — managing 50 servers by hand is practically impossible.

What problems does IaC solve?

Because infrastructure is now code, it's versioned in Git and it's clear who changed what and when. It goes through code review, can be rebuilt from scratch with one command, and keeps dev/test/prod environments identical.

How do you get started with IaC using Terraform?

Terraform is the most common IaC tool and works with many providers such as AWS, GCP, and Azure. You write the desired state declaratively; Terraform computes the diff against reality and applies it. The core flow is: `terraform init` initializes, `terraform plan` shows what will happen, and `terraform apply` applies it.

How do you bring a hand-created resource under Terraform management?

First declare the resource in code (don't apply yet), then bind the existing resource to state with `terraform import`. Then align the code to reality with `terraform plan` until you see 'No changes'. Running apply without importing makes Terraform try to create a second resource with the same name and conflict (e.g. 'BucketAlreadyExists').

Reading isn't enough — do it.

Practice these topics in an interactive terminal in your browser.