Ravindra BagaleCourses & study guides मराठी

Ravi Sir's Cards › Chapter 36: Terraform count for_each dynamic lifecycle and depends_on

Why is for_each often safer than count?

Why is for_each often safer than count? With count, resources are tracked by position. Remove the 2nd item and the 3rd moves to index 1, so Terraform changes or recreates it. With for_each, each resource is tracked by a key, so only the removed one is destroyed.

Why is for_each often safer than count? With count, resources are tracked by position. Remove the 2nd item and the 3rd moves to index 1, so Terraform changes or recreates it. With for_each, each resource is tracked by a key, so only the removed one is destroyed.
Download PNG

Lesson: 36.2 for_each — named copies that survive edits · मराठी card