»
coalescelist Function
Note: This page is about Terraform 0.12 and later. For Terraform 0.11 and earlier, see 0.11 Configuration Language: Interpolation Syntax.
coalescelist takes any number of list arguments and returns the first one
that isn't empty.
» Examples
> coalesce(["a", "b"], ["c", "d"])
[
"a",
"b",
]
> coalesce([], ["c", "d"])
[
"c",
"d",
]
To perform the coalesce operation with a list of lists, use the ...
symbol to expand the outer list as arguments:
> coalesce([[], ["c", "d"]]...)
[
"c",
"d",
]
» Related Functions
-
coalesceperforms a similar operation with string arguments rather than list arguments.