mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-01-17 14:00:20 -05:00
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.
40 lines
1.2 KiB
Markdown
40 lines
1.2 KiB
Markdown
---
|
|
layout: "functions"
|
|
page_title: "Configuration Functions"
|
|
sidebar_current: "docs-config-functions"
|
|
description: |-
|
|
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:
|
|
|
|
```hcl
|
|
max(5, 12, 9)
|
|
```
|
|
|
|
For more details on syntax, see
|
|
[_Function Calls_](/docs/configuration/expressions.html#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](/docs/commands/console.html):
|
|
|
|
```
|
|
> 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.
|