From 0e2e19c7846f887a69aaf4f461e82c3610902a92 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 12 Nov 2016 22:50:28 -0800 Subject: [PATCH] website: document required_version --- .../docs/configuration/terraform.html.md | 77 +++++++++++++++++++ website/source/layouts/docs.erb | 4 + 2 files changed, 81 insertions(+) create mode 100644 website/source/docs/configuration/terraform.html.md diff --git a/website/source/docs/configuration/terraform.html.md b/website/source/docs/configuration/terraform.html.md new file mode 100644 index 000000000..5effde086 --- /dev/null +++ b/website/source/docs/configuration/terraform.html.md @@ -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 +} +``` diff --git a/website/source/layouts/docs.erb b/website/source/layouts/docs.erb index e82527976..664670302 100644 --- a/website/source/layouts/docs.erb +++ b/website/source/layouts/docs.erb @@ -49,6 +49,10 @@ Modules + > + Terraform + + > Atlas