Back to Packer

`anytrue` Function

website/content/docs/templates/hcl_templates/functions/collection/anytrue.mdx

1.15.3866 B
Original Source

⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️

[!IMPORTANT]
Documentation Update: Product documentation previously located in /website has moved to the hashicorp/web-unified-docs repository, where all product documentation is now centralized. Please make contributions directly to web-unified-docs, since changes to /website in this repository will not appear on developer.hashicorp.com. ⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️

anytrue Function

anytrue returns true if any element in a given collection is true or "true". It also returns false if the collection is empty.

hcl
anytrue(list)

Examples

command
> anytrue(["true"])
true
> anytrue([true])
true
> anytrue([true, false])
true
> anytrue([])
false