github.com/muratcelep/terraform@v1.1.0-beta2-not-internal-4/website/docs/configuration/expressions.html.md (about) 1 --- 2 layout: "language" 3 page_title: "Expressions Landing Page - Configuration Language" 4 sidebar_current: "docs-config-expressions" 5 --- 6 7 # Expressions Landing Page 8 9 To improve navigation, we've split the old Expressions page into several smaller 10 pages. 11 12 <a id="types-and-values"></a> 13 <a id="advanced-type-details"></a> 14 <a id="type-conversion"></a> 15 <a id="literal-expressions"></a> 16 <a id="indices-and-attributes"></a> 17 18 ## Types and Values, Literal Expressions, Indices and Attributes 19 20 Terraform's types are `string`, `number`, `bool`, `list`, `tuple`, `map`, 21 `object`, and `null`. 22 23 This information has moved to 24 [Types and Values](/docs/language/expressions/types.html). 25 26 <div style="height: 30vh; margin: 0; padding: 0;"></div> 27 28 29 30 <a id="references-to-named-values"></a> 31 <a id="local-named-values"></a> 32 <a id="named-values-and-dependencies"></a> 33 <a id="references-to-resource-attributes"></a> 34 <a id="local-named-values-1"></a> 35 <a id="values-not-yet-known"></a> 36 37 ## References to Named Values (Resource Attributes, Variables, etc.) 38 39 You can refer to certain values by name, like `var.some_variable` or 40 `aws_instance.example.ami`. 41 42 This information has moved to 43 [References to Values](/docs/language/expressions/references.html). 44 45 <div style="height: 30vh; margin: 0; padding: 0;"></div> 46 47 48 49 <a id="arithmetic-operators"></a> 50 <a id="equality-operators"></a> 51 <a id="comparison-operators"></a> 52 <a id="logical-operators"></a> 53 54 ## Arithmetic and Logical Operators 55 56 Operators are expressions that transform other expressions, like adding two 57 numbers (`+`) or comparing two values to get a bool (`==`, `>=`, etc.). 58 59 This information has moved to 60 [Operators](/docs/language/expressions/operators.html). 61 62 <div style="height: 30vh; margin: 0; padding: 0;"></div> 63 64 65 66 ## Conditional Expressions 67 68 The `condition ? true_val : false_val` expression chooses between two 69 expressions based on a bool condition. 70 71 This information has moved to 72 [Conditional Expressions](/docs/language/expressions/conditionals.html). 73 74 <div style="height: 30vh; margin: 0; padding: 0;"></div> 75 76 77 78 <a id="expanding-function-arguments"></a> 79 <a id="available-functions"></a> 80 81 ## Function Calls 82 83 Terraform's functions can be called like `function_name(arg1, arg2)`. 84 85 This information has moved to 86 [Function Calls](/docs/language/expressions/function-calls.html). 87 88 <div style="height: 30vh; margin: 0; padding: 0;"></div> 89 90 91 92 <a id="for-expressions"></a> 93 94 ## `for` Expressions 95 96 Expressions like `[for s in var.list : upper(s)]` can transform a complex type 97 value into another complex type value. 98 99 This information has moved to 100 [For Expressions](/docs/language/expressions/for.html). 101 102 <div style="height: 30vh; margin: 0; padding: 0;"></div> 103 104 105 106 <a id="splat-expressions"></a> 107 <a id="legacy-attribute-only-splat-expressions"></a> 108 109 ## Splat Expressions 110 111 Expressions like `var.list[*].id` can extract simpler collections from complex 112 collections. 113 114 This information has moved to 115 [Splat Expressions](/docs/language/expressions/splat.html). 116 117 <div style="height: 30vh; margin: 0; padding: 0;"></div> 118 119 120 121 <a id="dynamic-blocks"></a> 122 <a id="best-practices-for-dynamic-blocks"></a> 123 124 ## `dynamic` Blocks 125 126 The special `dynamic` block type serves the same purpose as a `for` expression, 127 except it creates multiple repeatable nested blocks instead of a complex value. 128 129 This information has moved to 130 [Dynamic Blocks](/docs/language/expressions/dynamic-blocks.html). 131 132 <div style="height: 30vh; margin: 0; padding: 0;"></div> 133 134 135 136 <a id="string-literals"></a> 137 <a id="string-templates"></a> 138 <a id="interpolation"></a> 139 <a id="directives"></a> 140 141 ## String Literals and String Templates 142 143 Strings can be `"double-quoted"` or 144 145 ```hcl 146 <<EOT 147 heredocs 148 EOT 149 ``` 150 151 Strings can also include escape sequences like `\n`, interpolation sequences 152 (`${ ... }`), and template sequences (`%{ ... }`). 153 154 This information has moved to 155 [Strings and Templates](/docs/language/expressions/strings.html). 156 157 <div style="height: 30vh; margin: 0; padding: 0;"></div>