You can use terraform setsubtract() function to get relative complement between two sets. setsubtract() function returns a new set containing the elements from the first set that are not present in the second set. In other words, it computes the relative complement of the second set.
Syntax: setsubtract(set1, set2)
Example:
1 2 3 4 5 6 7 8 9 |
## Open terraform console terraform console ## Get relative complement between two sets setsubtract(["a", "b", "c"], ["a", "c"]) ## returns ## [ ## "b", ## ] |