What is Infrastructure as Code (IaC)?

Turkish: Altyapı Kodu

Infrastructure as Code defines servers, networks, and cloud resources in versioned code files instead of manual console configuration.

What Is Infrastructure as Code?

Infrastructure as Code (IaC) is the practice of defining infrastructure resources such as servers, networks, databases, DNS, load balancers, and cloud permissions in code files instead of configuring them manually through consoles. These files are stored in Git, reviewed, and applied through automation.

IaC appears in two broad styles. In a declarative model, the desired final state is written and the tool calculates the changes needed. Terraform is a common example. In an imperative model, steps are described in order; Ansible playbooks are often used this way.

Why It Is Used

With manually configured infrastructure, it is hard to know which setting changed and when. IaC lets staging and production environments be created from the same definition, reviewed through pull requests, and rolled back when needed. A new customer environment, test cluster, or disaster recovery region can be created more consistently.

What to Watch

IaC files should not contain secrets, state files must be stored securely, and automated plan output should be reviewed carefully. Terraform can manage resource lifecycles, while Ansible may complement it for configuration and application preparation.