Skip to main content
Stores the state in the Consul KV store at a given path. This backend supports state locking. Read more about this backend in the Terraform docs: https://developer.hashicorp.com/terraform/language/settings/backends/consul

Initializer

import cdktn

cdktn.ConsulBackendConfig(
  access_token: str,
  path: str,
  address: str = None,
  ca_file: str = None,
  cert_file: str = None,
  datacenter: str = None,
  gzip: bool = None,
  http_auth: str = None,
  key_file: str = None,
  lock: bool = None,
  scheme: str = None
)

Properties

NameTypeDescription
access_tokenstr(Required) Access token.
pathstr(Required) Path in the Consul KV store.
addressstr(Optional) DNS name and port of your Consul endpoint specified in the format dnsname:port.
ca_filestr(Optional) A path to a PEM-encoded certificate authority used to verify the remote agent’s certificate.
cert_filestr(Optional) A path to a PEM-encoded certificate provided to the remote agent;
datacenterstr(Optional) The datacenter to use.
gzipbool(Optional) true to compress the state data using gzip, or false (the default) to leave it uncompressed.
http_authstr(Optional) HTTP Basic Authentication credentials to be used when communicating with Consul, in the format of either user or user:pass.
key_filestr(Optional) A path to a PEM-encoded private key, required if cert_file is specified.
lockbool(Optional) false to disable locking.
schemestr(Optional) Specifies what protocol to use when talking to the given address,either http or https.

access_tokenRequired

access_token: str
  • Type: str
(Required) Access token.

pathRequired

path: str
  • Type: str
(Required) Path in the Consul KV store.

addressOptional

address: str
  • Type: str
(Optional) DNS name and port of your Consul endpoint specified in the format dnsname:port. Defaults to the local agent HTTP listener.

ca_fileOptional

ca_file: str
  • Type: str
(Optional) A path to a PEM-encoded certificate authority used to verify the remote agent’s certificate.

cert_fileOptional

cert_file: str
  • Type: str
(Optional) A path to a PEM-encoded certificate provided to the remote agent; requires use of key_file.

datacenterOptional

datacenter: str
  • Type: str
(Optional) The datacenter to use. Defaults to that of the agent.

gzipOptional

gzip: bool
  • Type: bool
(Optional) true to compress the state data using gzip, or false (the default) to leave it uncompressed.

http_authOptional

http_auth: str
  • Type: str
(Optional) HTTP Basic Authentication credentials to be used when communicating with Consul, in the format of either user or user:pass.

key_fileOptional

key_file: str
  • Type: str
(Optional) A path to a PEM-encoded private key, required if cert_file is specified.

lockOptional

lock: bool
  • Type: bool
(Optional) false to disable locking. This defaults to true, but will require session permissions with Consul and at least kv write permissions on $path/.lock to perform locking.

schemeOptional

scheme: str
  • Type: str
(Optional) Specifies what protocol to use when talking to the given address,either http or https. SSL support can also be triggered by setting then environment variable CONSUL_HTTP_SSL to true.