Why IaC#
Clicking through consoles is hard to reuse and audit. Infrastructure as code (IaC) describes resources in code, making changes reviewable and reversible.
Terraform core concepts#
- Configuration:
*.tffiles declare the desired state - State: maps real resources to the configuration
- Provider: plugins for cloud vendors (AWS, Alibaba Cloud, etc.)
- Plan / Apply: preview changes, then execute
Example#
resource "aws_instance" "web" {
ami = "ami-0c55b159cbfafe1f0"
instance_type = "t3.micro"
}Best practices#
- Keep state in a remote backend (S3 + locking) to avoid conflicts
- Use modules to reuse common resource patterns
- Handle secrets via variables and encrypted storage
Summary#
Terraform makes cloud management as rigorous as writing code — declarative, auditable, reversible. It’s the bedrock of modern ops.

