Terraform for_each: Replacing Count's Fragile Indexing with Stable Keys
Terraform's for_each meta-argument solves count's index-shift problem by addressing resources with stable keys. See a worked IAM example, targeting commands, and the plan-time trade-offs to watch.