Back to Packer

Built-in functions overview

website/content/docs/templates/hcl_templates/functions/index.mdx

1.15.31.2 KB
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. ⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️⚠️

Built-in functions overview

This topic provides an overview of the built-in HashiCorp configuration language (HCL) functions you can use in your Packer templates.

Functions syntax

You can use functions in Packer templates to transform and combine values. The syntax for function calls is a function name followed by comma-separated arguments in parentheses:

hcl
max(5, 12, 9)

For information on invoking functions in string literals, refer to the string literals reference section.

HCL does not support user-defined functions. You can only call the functions built into the language.