You can use terraform slice() function to get some elements from a list based on their position. slice() extracts some consecutive elements from within a list.
Syntax: slice(list, startindex, endindex)
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
## Open terraform console terraform console ## Get some elements from a list based on position slice([1,2,3,4,5,6,7,8,9], 2, 7) ## returns ## [ ## 3, ## 4, ## 5, ## 6, ## 7, ## ] |