Moving Terraform from count to for_each Is a State Migration
count identities are numeric indexes; for_each identities are keys. Switching syntax without mapping addresses can make unchanged infrastructure look like replacement work.
count identities are numeric indexes; for_each identities are keys. Switching syntax without mapping addresses can make unchanged infrastructure look like replacement work.
The keys in for_each become part of resource addresses. Renaming a key can look like deleting one object and creating another even when the human thinks only a label changed.