Interview Prep/Terraform/Lost, Corrupted and Drifted State

Plans always show `~ tags_all` changes on hundreds of resources after adding `default_tags` to the provider.

IntermediateTroubleshootingLost, Corrupted and Drifted State
Answer

Likely causes → Normal on the first apply after adding default_tags. Persisting changes come from a resource also setting the same tag key in tags with a different value, or a tag value computed at apply time (for example timestamp()).

Diagnose → terraform plan | grep -B3 -A6 tags_all to see which keys flip.

Fix → Apply once. Remove duplicated keys from resource-level tags, and never use timestamp()/uuid() in tags.

Prevent → Put static org tags only in default_tags; keep resource tags for resource-specific keys.

All Terraform questions Roadmap: Terraform in production

More on Lost, Corrupted and Drifted State