Interview Prep/Terraform/IaC and Terraform Fundamentals

What is the difference between declarative and imperative infrastructure tools?

BeginnerConceptIaC and Terraform Fundamentals
Answer

Declarative tools (Terraform, CloudFormation) describe the desired end state and the tool works out the steps. Imperative tools (shell scripts, AWS CLI, many Ansible playbooks) describe the steps to run in order. Declarative is easier to re-run safely because the tool diffs desired against actual; imperative gives more control but you own idempotency yourself.

All Terraform questions Roadmap: Terraform

More on IaC and Terraform Fundamentals