Exercise 2: terraform.tfvars vs. a -var CLI Flag — Possible Solution ==================================================================== Terraform uses `us-west-2` -- the value from the `-var` command-line flag. Per the chapter's precedence order (lowest to highest priority): environment variables, then `terraform.tfvars`, then `terraform.tfvars.json`, then `*.auto.tfvars` files in alphabetical order, then `-var`/`-var-file` command-line flags. Command-line flags sit at the very top of that list -- they always win over every file-based source, specifically because they're the most recent, most explicit signal of intent available at the moment a command actually runs. `terraform.tfvars` is a durable, checked-in default; a `-var` flag is a deliberate, one-off override typed at the exact moment of that specific run, and Terraform's precedence order treats that immediacy as taking priority over any file sitting in the directory. This is worth being genuinely careful about in practice: a plan run with `-var="region=us-west-2"` will silently produce a completely different result than the same command without that flag, even though `terraform.tfvars` itself never changed -- exactly the situation the chapter's own tip-box warns about, where a plan doesn't match what the `.tfvars` file alone seems to say. WHY THIS WORKS AS AN ANSWER ------------------------------ This states the correct winning value, cites the specific precedence rule that determines it, and explains WHY command-line flags rank highest (deliberate, in-the-moment override vs. a durable file default) rather than just reciting the ordered list without justification.