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/language/functions/contains.mdx

25 lines
634 B

---
page_title: contains - Functions - Configuration Language
description: The contains function determines whether a list or set contains a given value.
---
# `contains` Function
`contains` determines whether the list, tuple, or set given in its first
argument contains at least one element that is equal to the value in the second
argument, using the same definition of equality as the `==` operator described in
[Equality Operators](/terraform/language/expressions/operators#equality-operators).
```hcl
contains(list, value)
```
## Examples
```
> contains(["a", "b", "c"], "a")
true
> contains(["a", "b", "c"], "d")
false
```