Packer
Built-in Functions
Note: This page is about HCL2 in Packer 1.5 and later. HCL2 support for Packer is still in Beta. Please see the Packer Issue Tracker for a list of supported features. For the old-style stable configuration language see template docs. You can now transform your JSON file into an HCL2 config file using the hcl2_upgrade command.
The HCL language includes a number of built-in functions that you can call from within expressions to transform and combine values. The general syntax for function calls is a function name followed by comma-separated arguments in parentheses:
max(5, 12, 9)
For more details on syntax, see Function Calls on the Expressions page.
The HCL language does not support user-defined functions, and so only the functions built in to the language are available for use. The navigation for this section includes a list of all of the available built-in functions.