Skip to main content

Infrastructure as Code for DevOps Engineers

Infrastructure as code means defining servers, networks and services in versioned files instead of clicking in a console. Terraform and OpenTofu declare resources and track them in state, configuration management tools like Ansible configure machines, and policy and testing tools check the code before it changes real infrastructure.

Stage: Cloud and Infrastructure as Code · Part of the DevOps Engineer roadmap · Last reviewed 19 November 2026

What to learn in Infrastructure as Code

Infrastructure as Code interview questions

What is Terraform state and why does it matter?

State is a record mapping your configuration to real resources and their attributes. Terraform uses it to compute what to create, change or destroy. It should be stored remotely with locking and protected, since it can hold sensitive values.

What does idempotent mean for configuration management?

An idempotent operation gives the same result no matter how many times it is applied. Running an Ansible playbook twice should change nothing the second time, which makes automation safe to repeat and lets you detect drift.

Where Infrastructure as Code fits in the DevOps Engineer roadmap

Infrastructure as Code belongs to the Cloud and Infrastructure as Code stage (intermediate level), which takes about 1 hours. Provision repeatably.

Back to the full DevOps Engineer roadmap