github.com/rstandt/terraform@v0.12.32-0.20230710220336-b1063613405c/website/docs/configuration/functions/merge.html.md (about)

     1  ---
     2  layout: "functions"
     3  page_title: "merge - Functions - Configuration Language"
     4  sidebar_current: "docs-funcs-collection-merge"
     5  description: |-
     6    The merge function takes an arbitrary number of maps and returns a single
     7    map after merging the keys from each argument.
     8  ---
     9  
    10  # `merge` Function
    11  
    12  -> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and
    13  earlier, see
    14  [0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html).
    15  
    16  `merge` takes an arbitrary number of maps and returns a single map that
    17  contains a merged set of elements from all of the maps.
    18  
    19  If more than one given map defines the same key then the one that is later
    20  in the argument sequence takes precedence.
    21  
    22  ## Examples
    23  
    24  ```
    25  > merge({"a"="b", "c"="d"}, {"e"="f", "c"="z"})
    26  {
    27    "a" = "b"
    28    "c" = "z"
    29    "e" = "f"
    30  }
    31  ```