Previously we just listed out all of the functions in alphabetical order inside the "Interpolation Syntax" page, but that format doesn't leave much room for details and usage examples. Now we give each function its own page, and categorize them for easier navigation. While many functions are very simple and don't really warrant a full page, certain functions do have additional details that are worth mentioning and this structure scales better for those more complicated functions. So far this includes only the numeric and string functions. Other categories will follow in subsequent commits.
1.2 KiB
layout, page_title, sidebar_current, description
| layout | page_title | sidebar_current | description |
|---|---|---|---|
| functions | Configuration Functions | docs-config-functions | The Terraform language has a number of built-in functions that can be called from within expressions to transform and combine values. |
Built-in Functions
The Terraform 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 Terraform language does not support user-defined functions, and so only the functions built in to the language are available for use. The navigation includes a list of all of the available built-in functions.
You can experiment with the behavior of Terraform's built-in functions from
the Terraform expression console, by running
the terraform console command:
> max(5, 12, 9)
12
The examples in the documentation for each function use console output to illustrate the result of calling the function with different parameters.