You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
terraform/website/docs/configuration/functions/coalescelist.html.md

799 B

layout page_title sidebar_current description
functions coalescelist function docs-funcs-collection-coalescelist The coalescelist function takes any number of list arguments and returns the first one that isn't empty.

coalescelist Function

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",
]
  • coalesce performs a similar operation with string arguments rather than list arguments.