After applying VLANs with Terraform, an engineer deletes the state file and runs apply again against the same HCL. What role does state play that this action risks breaking?
Select an answer to reveal the explanation.
Short Explanation
State is Terraform’s notebook of what it already owns—lose the notebook and the next plan may try to recreate objects that already exist. It is not a Git commit note or an Ansible/Puppet file.
Full Explanation
Terraform state is the authoritative record of what Terraform last applied and therefore owns. It lets the next plan compare desired HCL to real objects instead of guessing. When an engineer deletes the state file and runs apply again against the same VLAN HCL, Terraform may try to create resources that already exist on the civic switch, fail noisily, or orphan unmanaged configuration—breaking the convergent workflow state was meant to protect.
Treating state as only a Git commit message that can be deleted without impact fails: state is operational data, not a comment. Calling state an Ansible inventory cache that Terraform never consults invents a false architecture. Calling state the Puppet catalog required before any Terraform plan can run mixes discarded Puppet concepts into Terraform and misleads operators.
Exam caveat: use remote state with locking for teams working on shared municipal stacks; never hand-edit state as routine. terraform import can reclaim objects after accidental loss, but backups and remote backends prevent the incident.
Operational check: back up state before experiments, delete state in a lab only to observe plan proposing re-creates of existing VLANs, then restore state and confirm plans become convergent again.