How do you inspect what Terraform thinks it manages?
BeginnerScenarioState Backends and Workspaces
Answer
Situation read → You want to see what's in state.
What I'd do →
terraform state list
terraform state show aws_instance.web
terraform show -json | jq '.values.root_module.resources[].address'
terraform state pull > snapshot.json
Why → state list gives addresses, state show gives attributes, and pull writes the raw JSON for offline inspection.
Interview tip → State is JSON but never edit it by hand; use state mv, rm or import.
More on State Backends and Workspaces
Two engineers keep overwriting each other's changes because state is local. What's the fix?BeginnerSet up a production-grade S3 backend. What do you configure for locking?IntermediateHow do you harden the S3 bucket that holds Terraform state?IntermediateWho creates the state bucket itself, given Terraform needs it to exist before `init`?IntermediateA laptop apply and a CI apply start at the same time. What stops state corruption?IntermediateWhen are Terraform workspaces appropriate?Beginner