terraform/website/docs/configuration/functions/sethaselement.html.md

954 B

layout page_title sidebar_current description
functions sethaselement - Functions - Configuration Language docs-funcs-collection-sethaselement The sethaselement function tests whether a given value is in a given set.

sethaselement Function

-> Note: This page is about Terraform 0.12 and later. For Terraform 0.11 and earlier, see 0.11 Configuration Language: Interpolation Syntax.

The sethaselement function tests whether a given value is in a given set.

sethaselement(set, value)

Examples

> sethaselement(["a", "b"], "b")
true
> sethaselement(["a", "b"], "c")
false
  • setintersection computes the intersection of multiple sets.
  • setproduct computes the cartesian product of multiple sets.
  • setunion computes the union of multiple sets.