mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-01-02 13:00:45 -05:00
1.6 KiB
1.6 KiB
layout, page_title, sidebar_current, description
| layout | page_title | sidebar_current | description |
|---|---|---|---|
| remotestate | Remote State Backend: consul | docs-state-remote-consul | Terraform can store the state remotely, making it easier to version and work with in a team. |
consul
Stores the state in the Consul KV store at a given path.
-> Note: Specifying access_token directly makes it included in
cleartext inside the persisted, shard state.
Use of the environment variable CONSUL_HTTP_TOKEN is recommended.
Example Usage
terraform remote config \
-backend=consul \
-backend-config="path=full/path"
Example Referencing
data "terraform_remote_state" "foo" {
backend = "consul"
config {
path = "full/path"
}
}
Configuration variables
The following configuration options / environment variables are supported:
path- (Required) Path in the Consul KV storeaccess_token/CONSUL_HTTP_TOKEN- (Required) Access tokenaddress/CONSUL_HTTP_ADDR- (Optional) DNS name and port of your Consul endpoint specified in the formatdnsname:port. Defaults to the local agent HTTP listener.scheme- (Optional) Specifies what protocol to use when talking to the givenaddress, eitherhttporhttps. SSL support can also be triggered by setting then environment variableCONSUL_HTTP_SSLtotrue.datacenter- (Optional) The datacenter to use. Defaults to that of the agent.http_auth/CONSUL_HTTP_AUTH- (Optional) HTTP Basic Authentication credentials to be used when communicating with Consul, in the format of eitheruseroruser:pass.