From 707f39b44038e6a5f41caa75bf2e4b82a1658b92 Mon Sep 17 00:00:00 2001 From: Dirk Leser <44613881+dleser@users.noreply.github.com> Date: Fri, 6 May 2022 09:28:42 +0200 Subject: [PATCH] Added example with function argument expansion Even if the expansion with three dots is explicity mentioned in https://www.terraform.io/language/expressions/function-calls#expanding-function-arguments the additional example would have helped me a lot as it is a common use case to "flatten" a list of maps. --- website/docs/language/functions/merge.mdx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/website/docs/language/functions/merge.mdx b/website/docs/language/functions/merge.mdx index 22e97d35e0..3cd78a7dfa 100644 --- a/website/docs/language/functions/merge.mdx +++ b/website/docs/language/functions/merge.mdx @@ -27,6 +27,15 @@ type structure of the attributes after the merging rules have been applied. } ``` +``` +> merge([{a="b", c="d"}, {}, {e="f", c="z"}]...) +{ + "a" = "b" + "c" = "z" + "e" = "f" +} +``` + ``` > merge({a="b"}, {a=[1,2], c="z"}, {d=3}) {