You can use terraform setunion() function to combine multiple sets into a single set. setunion() function takes multiple sets and produces a single set containing the elements from all of the given sets. In other words, it computes the union of the sets.
Syntax: setunion(set1, set2, ..)
Example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
## Open terraform console terraform console ## Combine multiple sets into a single setunion([1,2],[2,3],[3,4],[5,6]) ## returns ## [ ## 1, ## 2, ## 3, ## 4, ## 5, ## 6, ## ] |