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

     1  ---
     2  layout: "functions"
     3  page_title: "contains - Functions - Configuration Language"
     4  sidebar_current: "docs-funcs-collection-contains"
     5  description: |-
     6    The contains function determines whether a list or set contains a given value.
     7  ---
     8  
     9  # `contains` Function
    10  
    11  -> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and
    12  earlier, see
    13  [0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html).
    14  
    15  `contains` determines whether a given list or set contains a given single value
    16  as one of its elements.
    17  
    18  ```hcl
    19  contains(list, value)
    20  ```
    21  
    22  ## Examples
    23  
    24  ```
    25  > contains(["a", "b", "c"], "a")
    26  true
    27  > contains(["a", "b", "c"], "d")
    28  false
    29  ```