github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/configuration/terraform.html.md (about) 1 --- 2 layout: "docs" 3 page_title: "Configuring Terraform" 4 sidebar_current: "docs-config-terraform" 5 description: |- 6 The `terraform` configuration section is used to configure Terraform itself, such as requiring a minimum Terraform version to execute a configuration. 7 --- 8 9 # Terraform Configuration 10 11 The `terraform` configuration section is used to configure Terraform itself, 12 such as requiring a minimum Terraform version to execute a configuration. 13 14 This page assumes you're familiar with the 15 [configuration syntax](/docs/configuration/syntax.html) 16 already. 17 18 ## Example 19 20 Terraform configuration looks like the following: 21 22 ```hcl 23 terraform { 24 required_version = "> 0.7.0" 25 } 26 ``` 27 28 ## Description 29 30 The `terraform` block configures the behavior of Terraform itself. 31 32 The currently only allowed configuration within this block is 33 `required_version`. This setting specifies a set of version constraints 34 that must be met to perform operations on this configuration. If the 35 running Terraform version doesn't meet these constraints, an error 36 is shown. See the section below dedicated to this option. 37 38 **No value within the `terraform` block can use interpolations.** The 39 `terraform` block is loaded very early in the execution of Terraform 40 and interpolations are not yet available. 41 42 ## Specifying a Required Terraform Version 43 44 The `required_version` setting can be used to require a specific version 45 of Terraform. If the running version of Terraform doesn't match the 46 constraints specified, Terraform will show an error and exit. 47 48 When [modules](/docs/configuration/modules.html) are used, all Terraform 49 version requirements specified by the complete module tree must be 50 satisified. This means that the `required_version` setting can be used 51 by a module to require that all consumers of a module also use a specific 52 version. 53 54 The value of this configuration is a comma-separated list of constraints. 55 A constraint is an operator followed by a version, such as `> 0.7.0`. 56 Constraints support the following operations: 57 58 - `=` (or no operator): exact version equality 59 60 - `!=`: version not equal 61 62 - `>`, `>=`, `<`, `<=`: version comparison, where "greater than" is a larger 63 version number 64 65 - `~>`: pessimistic constraint operator. Example: for `~> 0.9`, this means 66 `>= 0.9, < 1.0`. Example: for `~> 0.8.4`, this means `>= 0.8.4, < 0.9` 67 68 For modules, a minimum version is recommended, such as `> 0.8.0`. This 69 minimum version ensures that a module operates as expected, but gives 70 the consumer flexibility to use newer versions. 71 72 ## Syntax 73 74 The full syntax is: 75 76 ```text 77 terraform { 78 required_version = VALUE 79 } 80 ```