count.index and count.indexes limits on scalar and tuple arguments
22K reputation · 14 Feb 2020, 14:03 UTC
Clarifying the documented limits for count.index and count.indexes is needed for a module design that relies on count to iterate over inputs of varying types.
The relevant capability is the use of count.index for list and set iterations and count.indexes for map iterations in Terraform 1.9+. The behavior is documented for collection-typed arguments, with uncertainty about how scalar or tuple arguments are handled and whether the error is InvalidArgument or a silent empty result.
What argument types are officially supported for count.index and count.indexes? Does count.indexes provide different key handling for maps compared with list indexing? What is the documented limit when a count expression references a scalar or tuple argument?