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

     1  ---
     2  layout: "functions"
     3  page_title: "join - Functions - Configuration Language"
     4  sidebar_current: "docs-funcs-string-join"
     5  description: |-
     6    The join function produces a string by concatenating the elements of a list
     7    with a given delimiter.
     8  ---
     9  
    10  # `join` 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  `join` produces a string by concatenating together all elements of a given
    17  list of strings with the given delimiter.
    18  
    19  ```hcl
    20  join(separator, list)
    21  ```
    22  
    23  ## Examples
    24  
    25  ```
    26  > join(", ", ["foo", "bar", "baz"])
    27  foo, bar, baz
    28  > join(", ", ["foo"])
    29  foo
    30  ```
    31  
    32  ## Related Functions
    33  
    34  * [`split`](./split.html) performs the opposite operation: producing a list
    35    by separating a single string using a given delimiter.