github.com/loicalbertin/terraform@v0.6.15-0.20170626182346-8e2583055467/website/docs/backends/types/consul.html.md (about)

     1  ---
     2  layout: "backend-types"
     3  page_title: "Backend Type: consul"
     4  sidebar_current: "docs-backends-types-standard-consul"
     5  description: |-
     6    Terraform can store state in Consul.
     7  ---
     8  
     9  # consul
    10  
    11  **Kind: Standard (with locking)**
    12  
    13  Stores the state in the [Consul](https://www.consul.io/) KV store at a given path.
    14  
    15  This backend supports [state locking](/docs/state/locking.html).
    16  
    17  ## Example Configuration
    18  
    19  ```hcl
    20  terraform {
    21    backend "consul" {
    22      address = "demo.consul.io"
    23      path    = "full/path"
    24    }
    25  }
    26  ```
    27  
    28  Note that for the access credentials we recommend using a
    29  [partial configuration](/docs/backends/config.html).
    30  
    31  ## Example Referencing
    32  
    33  ```hcl
    34  data "terraform_remote_state" "foo" {
    35    backend = "consul"
    36    config {
    37      path = "full/path"
    38    }
    39  }
    40  ```
    41  
    42  ## Configuration variables
    43  
    44  The following configuration options / environment variables are supported:
    45  
    46   * `path` - (Required) Path in the Consul KV store
    47   * `access_token` / `CONSUL_HTTP_TOKEN` - (Required) Access token
    48   * `address` / `CONSUL_HTTP_ADDR` - (Optional) DNS name and port of your Consul endpoint specified in the
    49     format `dnsname:port`. Defaults to the local agent HTTP listener.
    50   * `scheme` - (Optional) Specifies what protocol to use when talking to the given
    51     `address`, either `http` or `https`. SSL support can also be triggered
    52     by setting then environment variable `CONSUL_HTTP_SSL` to `true`.
    53   * `datacenter` - (Optional) The datacenter to use. Defaults to that of the agent.
    54   * `http_auth` / `CONSUL_HTTP_AUTH` - (Optional) HTTP Basic Authentication credentials to be used when
    55     communicating with Consul, in the format of either `user` or `user:pass`.
    56   * `gzip` - (Optional) `true` to compress the state data using gzip, or `false` (the default) to leave it uncompressed.
    57   * `lock` - (Optional) `false` to disable locking. This defaults to true, but will require session permissions with Consul to perform locking.