Skip to content
Captain's Academy0
← Terraform sea chart
Island 1 · IaC & Terraform · Port 1.1

Declarative vs imperative

Ask the Captain
Instagram
Run it twice. Do you get two servers, or one?
You'll learn to

explain declarative (describe the end state) vs imperative (list the steps) and why that makes Terraform idempotent

Recap

  1. 1Imperative = you write the steps (a script runs them again every time)
  2. 2Declarative = you write the end result, Terraform works out the steps
  3. 3Idempotent: apply again, same result. Change 3 to 5, Terraform adds only 2
Check yourself

You apply the same configuration twice and nothing changed. What happens the second time?

1.1

Stamp this lesson

Watched it and passed the check? Mark it in your logbook.