Add documentation.
This commit is contained in:
parent
54dc50ec5c
commit
8f7b315037
|
@ -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,
|
||||
},
|
||||
},
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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`.
|
Loading…
Reference in New Issue