mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-02-16 16:00:37 -05:00
As of this commit, that layout doesn't exist yet, but I'm isolating the one-line changes to their own commit to try and keep your eyes from glazing over.
1.0 KiB
1.0 KiB
layout, page_title, sidebar_current, description
| layout | page_title | sidebar_current | description |
|---|---|---|---|
| language | coalescelist - Functions - Configuration Language | docs-funcs-collection-coalescelist | The coalescelist function takes any number of list arguments and returns the first one that isn't empty. |
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
> coalescelist(["a", "b"], ["c", "d"])
[
"a",
"b",
]
> coalescelist([], ["c", "d"])
[
"c",
"d",
]
To perform the coalescelist operation with a list of lists, use the ...
symbol to expand the outer list as arguments:
> coalescelist([[], ["c", "d"]]...)
[
"c",
"d",
]
Related Functions
coalesceperforms a similar operation with string arguments rather than list arguments.