github.com/muratcelep/terraform@v1.1.0-beta2-not-internal-4/website/docs/language/expressions/index.html.md (about) 1 --- 2 layout: "language" 3 page_title: "Expressions - Configuration Language" 4 description: "An overview of expressions to reference or compute values in Terraform configurations, including types, operators, and functions." 5 --- 6 7 # Expressions 8 9 > **Hands-on:** Try the [Create Dynamic Expressions](https://learn.hashicorp.com/tutorials/terraform/expressions?in=terraform/configuration-language&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn. 10 11 _Expressions_ are used to refer to or compute values within a configuration. 12 The simplest expressions are just literal values, like `"hello"` or `5`, 13 but the Terraform language also allows more complex expressions such as 14 references to data exported by resources, arithmetic, conditional evaluation, 15 and a number of built-in functions. 16 17 Expressions can be used in a number of places in the Terraform language, 18 but some contexts limit which expression constructs are allowed, 19 such as requiring a literal value of a particular type or forbidding 20 [references to resource attributes](/docs/language/expressions/references.html#references-to-resource-attributes). 21 Each language feature's documentation describes any restrictions it places on 22 expressions. 23 24 You can experiment with the behavior of Terraform's expressions from 25 the Terraform expression console, by running 26 [the `terraform console` command](/docs/cli/commands/console.html). 27 28 The other pages in this section describe the features of Terraform's 29 expression syntax. 30 31 - [Types and Values](/docs/language/expressions/types.html) 32 documents the data types that Terraform expressions can resolve to, and the 33 literal syntaxes for values of those types. 34 35 - [Strings and Templates](/docs/language/expressions/strings.html) 36 documents the syntaxes for string literals, including interpolation sequences 37 and template directives. 38 39 - [References to Values](/docs/language/expressions/references.html) 40 documents how to refer to named values like variables and resource attributes. 41 42 - [Operators](/docs/language/expressions/operators.html) 43 documents the arithmetic, comparison, and logical operators. 44 45 - [Function Calls](/docs/language/expressions/function-calls.html) 46 documents the syntax for calling Terraform's built-in functions. 47 48 - [Conditional Expressions](/docs/language/expressions/conditionals.html) 49 documents the `<CONDITION> ? <TRUE VAL> : <FALSE VAL>` expression, which 50 chooses between two values based on a bool condition. 51 52 - [For Expressions](/docs/language/expressions/for.html) 53 documents expressions like `[for s in var.list : upper(s)]`, which can 54 transform a complex type value into another complex type value. 55 56 - [Splat Expressions](/docs/language/expressions/splat.html) 57 documents expressions like `var.list[*].id`, which can extract simpler 58 collections from more complicated expressions. 59 60 - [Dynamic Blocks](/docs/language/expressions/dynamic-blocks.html) 61 documents a way to create multiple repeatable nested blocks within a resource 62 or other construct. 63 64 - [Type Constraints](/docs/language/expressions/type-constraints.html) 65 documents the syntax for referring to a type, rather than a value of that 66 type. Input variables expect this syntax in their `type` argument. 67 68 - [Version Constraints](/docs/language/expressions/version-constraints.html) 69 documents the syntax of special strings that define a set of allowed software 70 versions. Terraform uses version constraints in several places.