Open
Description
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
At this moment, it's not possible to use forEach with certain arguments, despite their availability in HCL, e.g.
- Set of numbers (result of
Fn.range
) - Nested sets (result of
Fn.chunk
)
They are standard library functions and it makes little sense that they can't be used for iteration.
Workaround (Fn.chunk
):
const chunkList = Fn.chunklist(value, chunkSize)
const iterator = new ListTerraformIterator(Fn.slice([...Array(100).keys()].map(v => v.toString()), 0, Fn.lengthOf(chunkList)))
...
Fn.element(chunkList, iterator.value)