From 2d2da6fea0b3c2f0de98a2bab438f6f32307aabf Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 14 Feb 2017 14:46:20 -0800 Subject: [PATCH] wip --- website/source/docs/backends/index.html.md | 45 ++ website/source/docs/backends/init.html.md | 31 + website/source/docs/state/locking.html.md | 11 + website/source/layouts/docs.erb | 717 +++++++++++---------- 4 files changed, 458 insertions(+), 346 deletions(-) create mode 100644 website/source/docs/backends/index.html.md create mode 100644 website/source/docs/backends/init.html.md create mode 100644 website/source/docs/state/locking.html.md diff --git a/website/source/docs/backends/index.html.md b/website/source/docs/backends/index.html.md new file mode 100644 index 000000000..4a2ba4604 --- /dev/null +++ b/website/source/docs/backends/index.html.md @@ -0,0 +1,45 @@ +--- +layout: "docs" +page_title: "Backends" +sidebar_current: "docs-backends-index" +description: |- + A "backend" in Terraform determines how state is loaded and how an operation such as `apply` is executed. This abstraction enables non-local file state storage, remote execution, etc. +--- + +# Backends + +A "backend" in Terraform determines how state is loaded and how an operation +such as `apply` is executed. This abstraction enables non-local file state +storage, remote execution, etc. + +By default, Terraform uses the "local" backend, which is the normal behavior +of Terraform you're used to. This is the backend that was being invoked +throughout the [introduction](/intro/index.html). + +Here are some of the benefits of backends: + + * **Working in a team**: Backends can store their state remotely and + protect that state with locks to prevent corruption. Some backends + such as Terraform Enterprise even automatically store a history of + all state revisions. + + * **Keeping sensitive information off disk**: State is retrieved from + backends on demand and only stored in memory. If you're using a backend + such as Amazon S3, the only location the state ever is persisted is in + S3. + + * **Remote operations**: For larger infrastructures or certain changes, + `terraform apply` can take a long, long time. Some backends support + remote operations which enable the operation to execute remotely. You can + then turn off your computer and your operation will still complete. Paired + with remote state storage and locking above, this also helps in team + environments. + +**Backends are completely optional**. You can successfully use Terraform without +ever having to learn or use backends. However, they do solve pain points that +afflict teams at a certain scale. If you're an individual, you can likely +get away with never using backends. + +Even if you only intend to use the "local" backend, it may be useful to +learn about backends since you can also change the behavior of the local +backend. diff --git a/website/source/docs/backends/init.html.md b/website/source/docs/backends/init.html.md new file mode 100644 index 000000000..cbba0eb7d --- /dev/null +++ b/website/source/docs/backends/init.html.md @@ -0,0 +1,31 @@ +--- +layout: "docs" +page_title: "Backends: Init" +sidebar_current: "docs-backends-init" +description: |- + Terraform must initialize any configured backend before use. This can be done by simply running `terraform init`. +--- + +# Backend Initialization + +Terraform must initialize any configured backend before use. This can be +done by simply running `terraform init`. + +The `terraform init` command should be run by any member of your team on +any Terraform configuration as a first step. It is safe to execute multiple +times and performs all the setup actions required for a Terraform environment, +including initializing the backend. + +The `init` command must be called: + + * On any new environment that configures a backend + * On any change of the backend configuration (including type of backend) + * On removing backend configuration completely + +You don't need to remember these exact cases. Terraform will detect when +initialization is required and error in that situation. Terraform doesn't +auto-initialize because it may require additional information from the user, +perform state migrations, etc. + +The `init` command will do more than just initialize the backend. Please see +the [init documentation](/docs/commands/init.html) for more information. diff --git a/website/source/docs/state/locking.html.md b/website/source/docs/state/locking.html.md new file mode 100644 index 000000000..acfd6985b --- /dev/null +++ b/website/source/docs/state/locking.html.md @@ -0,0 +1,11 @@ +--- +layout: "docs" +page_title: "State: Locking" +sidebar_current: "docs-state-locking" +description: |- + Terraform stores state which caches the known state of the world the last time Terraform ran. +--- + +# State Locking + +TODO diff --git a/website/source/layouts/docs.erb b/website/source/layouts/docs.erb index 60020d3aa..8a00eff62 100644 --- a/website/source/layouts/docs.erb +++ b/website/source/layouts/docs.erb @@ -3,146 +3,146 @@ <% end %> - <%= yield %> - <% end %> + <%= yield %> +<% end %>