From 8f7b315037420411ff5869cc5ea6fc1433276227 Mon Sep 17 00:00:00 2001 From: Bruno Miguel Custodio Date: Fri, 8 Sep 2017 23:40:05 +0100 Subject: [PATCH] Add documentation. --- backend/remote-state/etcdv3/backend.go | 2 +- website/docs/backends/types/etcd.html.md | 2 +- website/docs/backends/types/etcdv3.html.md | 53 ++++++++++++++++++++++ 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 website/docs/backends/types/etcdv3.html.md diff --git a/backend/remote-state/etcdv3/backend.go b/backend/remote-state/etcdv3/backend.go index dfd63131d..c5f221964 100644 --- a/backend/remote-state/etcdv3/backend.go +++ b/backend/remote-state/etcdv3/backend.go @@ -45,7 +45,7 @@ func New() backend.Backend { "lock": &schema.Schema{ Type: schema.TypeBool, Optional: true, - Description: "Lock state access.", + Description: "Whether to lock state access.", Default: true, }, }, diff --git a/website/docs/backends/types/etcd.html.md b/website/docs/backends/types/etcd.html.md index 588a968bd..ce394ccc2 100644 --- a/website/docs/backends/types/etcd.html.md +++ b/website/docs/backends/types/etcd.html.md @@ -3,7 +3,7 @@ layout: "backend-types" page_title: "Backend Type: etcd" sidebar_current: "docs-backends-types-standard-etcd" description: |- - Terraform can store state remotely in etcd. + Terraform can store state remotely in etcd 2.x. --- # etcd diff --git a/website/docs/backends/types/etcdv3.html.md b/website/docs/backends/types/etcdv3.html.md new file mode 100644 index 000000000..53dbd7629 --- /dev/null +++ b/website/docs/backends/types/etcdv3.html.md @@ -0,0 +1,53 @@ +--- +layout: "backend-types" +page_title: "Backend Type: etcdv3" +sidebar_current: "docs-backends-types-standard-etcdv3" +description: |- + Terraform can store state remotely in etcd 3.x. +--- + +# etcdv3 + +**Kind: Standard (with locking)** + +Stores the state in the [etcd](https://coreos.com/etcd/) KV store wit a given prefix. + +This backend supports [state locking](/docs/state/locking.html). + +## Example Configuration + +```hcl +terraform { + backend "etcdv3" { + endpoints = ["etcd-1:2379", "etcd-2:2379", "etcd-3:2379"] + lock = true + prefix = "terraform-state/" + } +} +``` + +Note that for the access credentials we recommend using a +[partial configuration](/docs/backends/config.html). + +## Example Referencing + +```hcl +data "terraform_remote_state" "foo" { + backend = "etcdv3" + config { + endpoints = ["etcd-1:2379", "etcd-2:2379", "etcd-3:2379"] + lock = true + prefix = "terraform-state/" + } +} +``` + +## Configuration variables + +The following configuration options / environment variables are supported: + + * `endpoints` - (Required) The list of 'etcd' endpoints which to connect to. + * `username` - (Optional) Username used to connect to the etcd cluster. + * `password` - (Optional) Password used to connect to the etcd cluster. + * `prefix` - (Optional) An optional prefix to be added to keys when to storing state in etcd. Defaults to `""`. + * `lock` - (Optional) Whether to lock state access. Defaults to `true`.