From 8dbaf598f4493cd40b79164f92446f2ff0bb9717 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 24 Jul 2014 15:14:39 -0700 Subject: [PATCH] website: start config docs --- .../source/docs/configuration/index.html.md | 23 +++++ .../source/docs/configuration/load.html.md | 30 ++++++ website/source/layouts/docs.erb | 91 +++++++++++-------- 3 files changed, 104 insertions(+), 40 deletions(-) create mode 100644 website/source/docs/configuration/index.html.md create mode 100644 website/source/docs/configuration/load.html.md diff --git a/website/source/docs/configuration/index.html.md b/website/source/docs/configuration/index.html.md new file mode 100644 index 0000000000..6c015bfbdb --- /dev/null +++ b/website/source/docs/configuration/index.html.md @@ -0,0 +1,23 @@ +--- +layout: "docs" +page_title: "Configuration" +sidebar_current: "docs-config" +--- + +# Configuration + +Terraform uses text files to describe infrastructure and to set variables. +These text files are called Terraform _configurations_ and end in +`.tf`. This section talks about the format of these files as well as +how they're loaded. + +The format of the configuration files are able to be in two formats: +Terraform format and JSON. The Terraform format is more human-readable, +supports comments, and is the generally recommended format for most +Terraform files. The JSON format is meant for machines to create, +modify, and update, but can also be done by Terraform operators if +you prefer. Terraform format ends in `.tf` and JSON format ends in +`.tf.json`. + +Click a sub-section in the navigation to the left to learn more about +Terraform configuration. diff --git a/website/source/docs/configuration/load.html.md b/website/source/docs/configuration/load.html.md new file mode 100644 index 0000000000..66ed02b9a1 --- /dev/null +++ b/website/source/docs/configuration/load.html.md @@ -0,0 +1,30 @@ +--- +layout: "docs" +page_title: "Load Order and Semantics" +sidebar_current: "docs-config-load" +--- + +# Load Order and Semantics + +When invoking any command that loads the Terraform configuration, +Terraform loads all configuration files within the directory +specified in alphabetical order. The flies loaded must end in +either `.tf` or `.tf.json` to specify the format that is in use. +Otherwise, the files are ignored. + +[Override](/docs/configuration/override.html) +files are the exception, as they're loaded after all non-override +files, in alphabetical order. + +The configuration within the loaded files are appended to each +other. This is in contrast to being merged. This means that two +resources with the same name are not merged, and will instead +cause a validation error. This is in contrast to +[overrides](/docs/configuration/override.html), +which do merge. + +The order of variables, resources, etc. defined within the +configuration doesn't matter. Terraform configurations are +[declarative](http://en.wikipedia.org/wiki/Declarative_programming), +so references to other resources and variables do not depend +on the order they're defined. diff --git a/website/source/layouts/docs.erb b/website/source/layouts/docs.erb index c32287ca1d..c5125efb3c 100644 --- a/website/source/layouts/docs.erb +++ b/website/source/layouts/docs.erb @@ -8,87 +8,98 @@ > Configuration - - + + > Commands (CLI) > Providers - + > Provisioners - + > Guides - > Internals -