Back to Packer

`alltrue` Function

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

1.15.3831 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. ⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️

alltrue Function

alltrue returns true if all elements in a given collection are true or "true". It also returns true if the collection is empty.

hcl
alltrue(list)

Examples

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