mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-05-29 22:02:27 -04:00
Co-authored-by: Matthew Garrell <69917312+mgarrell777@users.noreply.github.com> Co-authored-by: Laura Pacilio <83350965+laurapacilio@users.noreply.github.com> Co-authored-by: Kevin Wang <kwangsan@gmail.com> Co-authored-by: Judith Malnick <judith@hashicorp.com> Co-authored-by: Martin Atkins <mart@degeneration.co.uk> Co-authored-by: HashiBot <62622282+hashibot-web@users.noreply.github.com>
39 lines
1.4 KiB
Plaintext
39 lines
1.4 KiB
Plaintext
---
|
|
page_title: Functions - Configuration Language
|
|
description: >-
|
|
An introduction to the built-in functions that you can use to transform and
|
|
combine values in expressions.
|
|
---
|
|
|
|
# Built-in Functions
|
|
|
|
> **Hands-on:** Try the [Perform Dynamic Operations with Functions](https://learn.hashicorp.com/tutorials/terraform/functions?in=terraform/configuration-language&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial.
|
|
|
|
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_](/language/expressions/function-calls)
|
|
in the Expressions section.
|
|
|
|
The Terraform language does not support user-defined functions, and so only
|
|
the functions built in to the language are available for use. The documentation includes a page for 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](/cli/commands/console):
|
|
|
|
```
|
|
> 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.
|