website: document required_version

This commit is contained in:
Mitchell Hashimoto 2016-11-12 22:50:28 -08:00
parent 2c467e0f74
commit 0e2e19c784
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
2 changed files with 81 additions and 0 deletions

View File

@ -0,0 +1,77 @@
---
layout: "docs"
page_title: "Configuring Terraform"
sidebar_current: "docs-config-terraform"
description: |-
Atlas is the ideal way to use Terraform in a team environment. Atlas will run Terraform for you, safely handle parallelization across different team members, save run history along with plans, and more.
---
# Terraform Configuration
The `terraform` configuration section is used to configure Terraform itself,
such as requiring a minimum Terraform version to execute a configuration.
This page assumes you're familiar with the
[configuration syntax](/docs/configuration/syntax.html)
already.
## Example
Terraform configuration looks like the following:
```
terraform {
required_version = "> 0.7.0"
}
```
## Description
The `terraform` block configures the behavior of Terraform itself.
The currently only allowed configuration within this block is
`required_version`. This setting specifies a set of version constraints
that must me bet to perform operations on this configuration. If the
running Terraform version doesn't meet these constraints, an error
is shown. See the section below dedicated to this option.
**No value within the `terraform` block can use interpolations.** The
`terraform` block is loaded very early in the execution of Terraform
and interpolations are not yet available.
## Specifying a Required Terraform Version
The `required_version` setting can be used to require a specific version
of Terraform. If the running version of Terraform doesn't match the
constraints specified, Terraform will show an error and exit.
When [modules](/docs/configuration/modules.html) are used, all Terraform
version requirements specified by the complete module tree must be
satisified. This means that the `required_version` setting can be used
by a module to require that all consumers of a module also use a specific
version.
The value of this configuration is a comma-separated list of constraints.
A constraint is an operator followed by a version, such as `> 0.7.0`.
Constraints support the following operations:
* `=` (or no operator): exact version equality
* `!=`: version not equal
* `>`, `>=`, `<`, `<=`: version comparison, where "greater than" is
a larger version number.
* `~>`: pessimistic constraint operator. Example: for `~> 0.9`, this means
`>= 0.9, < 1.0`. Example: for `~> 0.8.4`, this means `>= 0.8.4, < 0.9`
For modules, a minimum version is recommended, such as `> 0.8.0`. This
minimum version ensures that a module operates as expected, but gives
the consumer flexibility to use newer versions.
## Syntax
The full syntax is:
```
terraform {
required_version = VALUE
}
```

View File

@ -49,6 +49,10 @@
<a href="/docs/configuration/modules.html">Modules</a> <a href="/docs/configuration/modules.html">Modules</a>
</li> </li>
<li<%= sidebar_current("docs-config-terraform") %>>
<a href="/docs/configuration/terraform.html">Terraform</a>
</li>
<li<%= sidebar_current("docs-config-atlas") %>> <li<%= sidebar_current("docs-config-atlas") %>>
<a href="/docs/configuration/atlas.html">Atlas</a> <a href="/docs/configuration/atlas.html">Atlas</a>
</li> </li>