github.com/rvichery/terraform@v0.11.10/website/docs/backends/types/etcdv3.html.md (about) 1 --- 2 layout: "backend-types" 3 page_title: "Backend Type: etcdv3" 4 sidebar_current: "docs-backends-types-standard-etcdv3" 5 description: |- 6 Terraform can store state remotely in etcd 3.x. 7 --- 8 9 # etcdv3 10 11 **Kind: Standard (with locking)** 12 13 Stores the state in the [etcd](https://coreos.com/etcd/) KV store with a given prefix. 14 15 This backend supports [state locking](/docs/state/locking.html). 16 17 ## Example Configuration 18 19 ```hcl 20 terraform { 21 backend "etcdv3" { 22 endpoints = ["etcd-1:2379", "etcd-2:2379", "etcd-3:2379"] 23 lock = true 24 prefix = "terraform-state/" 25 } 26 } 27 ``` 28 29 Note that for the access credentials we recommend using a 30 [partial configuration](/docs/backends/config.html). 31 32 ## Example Referencing 33 34 ```hcl 35 data "terraform_remote_state" "foo" { 36 backend = "etcdv3" 37 config { 38 endpoints = ["etcd-1:2379", "etcd-2:2379", "etcd-3:2379"] 39 lock = true 40 prefix = "terraform-state/" 41 } 42 } 43 ``` 44 45 ## Configuration variables 46 47 The following configuration options / environment variables are supported: 48 49 * `endpoints` - (Required) The list of 'etcd' endpoints which to connect to. 50 * `username` / `ETCDV3_USERNAME` - (Optional) Username used to connect to the etcd cluster. 51 * `password` / `ETCDV3_PASSWORD` - (Optional) Password used to connect to the etcd cluster. 52 * `prefix` - (Optional) An optional prefix to be added to keys when to storing state in etcd. Defaults to `""`. 53 * `lock` - (Optional) Whether to lock state access. Defaults to `true`. 54 * `cacert_path` - (Optional) The path to a PEM-encoded CA bundle with which to verify certificates of TLS-enabled etcd servers. 55 * `cert_path` - (Optional) The path to a PEM-encoded certificate to provide to etcd for secure client identification. 56 * `key_path` - (Optional) The path to a PEM-encoded key to provide to etcd for secure client identification.