github.com/wikibal01/hashicorp-terraform@v0.11.12-beta1/website/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 configurations within this block are 33 `required_version` and `backend`. 34 35 `required_version` specifies a set of version constraints 36 that must be met to perform operations on this configuration. If the 37 running Terraform version doesn't meet these constraints, an error 38 is shown. See the section below dedicated to this option. 39 40 See [backends](/docs/backends/index.html) for more detail on the `backend` 41 configuration. 42 43 **No value within the `terraform` block can use interpolations.** The 44 `terraform` block is loaded very early in the execution of Terraform 45 and interpolations are not yet available. 46 47 ## Specifying a Required Terraform Version 48 49 The `required_version` setting can be used to require a specific version 50 of Terraform. If the running version of Terraform doesn't match the 51 constraints specified, Terraform will show an error and exit. 52 53 When [modules](/docs/configuration/modules.html) are used, all Terraform 54 version requirements specified by the complete module tree must be 55 satisified. This means that the `required_version` setting can be used 56 by a module to require that all consumers of a module also use a specific 57 version. 58 59 The value of this configuration is a comma-separated list of constraints. 60 A constraint is an operator followed by a version, such as `> 0.7.0`. 61 Constraints support the following operations: 62 63 - `=` (or no operator): exact version equality 64 65 - `!=`: version not equal 66 67 - `>`, `>=`, `<`, `<=`: version comparison, where "greater than" is a larger 68 version number 69 70 - `~>`: pessimistic constraint operator. Example: for `~> 0.9`, this means 71 `>= 0.9, < 1.0`. Example: for `~> 0.8.4`, this means `>= 0.8.4, < 0.9` 72 73 For modules, a minimum version is recommended, such as `> 0.8.0`. This 74 minimum version ensures that a module operates as expected, but gives 75 the consumer flexibility to use newer versions. 76 77 ## Syntax 78 79 The full syntax is: 80 81 ```text 82 terraform { 83 required_version = VALUE 84 } 85 ```