awesome-everything RU
↑ Back to the climb

Deployment & Infra

Infrastructure as Code: multiple-choice review

Crux Multiple-choice synthesis across the IaC unit — declarative desired state, the plan/apply diff engine, remote state, locking, drift, and immutable infrastructure.
Your altitude — climbing toward senior
ZeroJuniorMiddleSenior
You are at senior altitude — in orbit
◷ 13 min

Six questions that cut across the whole unit. Each one mirrors a judgment call you make at a terminal during a real change window — not a definition to recite, but a tradeoff to weigh while production is watching.

Goal

Confirm you can connect declarative desired state, the plan/apply diff engine, the role of the state file, locking under concurrency, and drift handling — the synthesis the lesson built toward.

Quiz

Your config declares an S3 bucket. You run apply once, then run apply again with no change to the config and no out-of-band change. What should happen on the second apply, and which property guarantees it?

Quiz

A teammate asks: 'Why keep a state file at all? Just refresh against the live cloud every time and diff that.' What is the strongest reason the state file is not optional?

Quiz

Two CI jobs both run `terraform apply` against the same backend nine seconds apart, with locking disabled via `-lock=false`. What is the core failure mode?

Quiz

A CI run crashed mid-apply and left a stale lock. The next pipeline fails fast with `Error acquiring the state lock`. A junior wants to run `terraform force-unlock` immediately and re-apply. What is the senior caution?

Quiz

During a 2am incident a teammate hand-edited a security-group rule in the console to stop the bleeding. Nobody touched the code. A routine `terraform apply` runs Tuesday morning. What is the danger, and what should have happened first?

Quiz

A generated database password ends up as a Terraform output, and the state file lives in an S3 bucket several engineers can read. What is the exposure, and what is the right pattern?

Recap

The through-line: you declare desired state, plan diffs it against the recorded state file (refreshing the provider first), and apply executes the diff idempotently. The state file is the identity map — source of truth and hazard at once: keep it in a versioned, locked remote backend, never route secrets through it, and confront drift deliberately with plan -refresh-only, deciding intent before an apply silently reverts an emergency fix. Lean toward immutable infrastructure so there is less to drift in the first place.

Continue the climb ↑Infrastructure as Code: free-recall review
shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.