What do `count.index`, `each.key` and `each.value` mean?
BeginnerConceptLoops, Conditionals, Dynamic Blocks and Functions
Answer
count.index is the zero-based position when count is used. With for_each over a map, each.key is the map key and each.value the element; over a set, key and value are both the string. They are only valid inside the resource or module that uses the meta-argument.
More on Loops, Conditionals, Dynamic Blocks and Functions
How does `count` work?BeginnerHow does `for_each` work?BeginnerWhen should you choose `for_each` over `count`?IntermediateHow do you use `for_each` with a list of objects?IntermediateWhat does "The for_each value depends on resource attributes that cannot be determined until apply" mean?AdvancedHow do you create a resource conditionally?Beginner