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

using Io.Cdktn;

new ConsulBackendConfig {
    string AccessToken,
    string Path,
    string Address = null,
    string CaFile = null,
    string CertFile = null,
    string Datacenter = null,
    bool Gzip = null,
    string HttpAuth = null,
    string KeyFile = null,
    bool Lock = null,
    string Scheme = null
};

Properties

NameTypeDescription
AccessTokenstring(Required) Access token.
Pathstring(Required) Path in the Consul KV store.
Addressstring(Optional) DNS name and port of your Consul endpoint specified in the format dnsname:port.
CaFilestring(Optional) A path to a PEM-encoded certificate authority used to verify the remote agent’s certificate.
CertFilestring(Optional) A path to a PEM-encoded certificate provided to the remote agent;
Datacenterstring(Optional) The datacenter to use.
Gzipbool(Optional) true to compress the state data using gzip, or false (the default) to leave it uncompressed.
HttpAuthstring(Optional) HTTP Basic Authentication credentials to be used when communicating with Consul, in the format of either user or user:pass.
KeyFilestring(Optional) A path to a PEM-encoded private key, required if cert_file is specified.
Lockbool(Optional) false to disable locking.
Schemestring(Optional) Specifies what protocol to use when talking to the given address,either http or https.

AccessTokenRequired

public string AccessToken { get; set; }
  • Type: string
(Required) Access token.

PathRequired

public string Path { get; set; }
  • Type: string
(Required) Path in the Consul KV store.

AddressOptional

public string Address { get; set; }
  • Type: string
(Optional) DNS name and port of your Consul endpoint specified in the format dnsname:port. Defaults to the local agent HTTP listener.

CaFileOptional

public string CaFile { get; set; }
  • Type: string
(Optional) A path to a PEM-encoded certificate authority used to verify the remote agent’s certificate.

CertFileOptional

public string CertFile { get; set; }
  • Type: string
(Optional) A path to a PEM-encoded certificate provided to the remote agent; requires use of key_file.

DatacenterOptional

public string Datacenter { get; set; }
  • Type: string
(Optional) The datacenter to use. Defaults to that of the agent.

GzipOptional

public bool Gzip { get; set; }
  • Type: bool
(Optional) true to compress the state data using gzip, or false (the default) to leave it uncompressed.

HttpAuthOptional

public string HttpAuth { get; set; }
  • Type: string
(Optional) HTTP Basic Authentication credentials to be used when communicating with Consul, in the format of either user or user:pass.

KeyFileOptional

public string KeyFile { get; set; }
  • Type: string
(Optional) A path to a PEM-encoded private key, required if cert_file is specified.

LockOptional

public bool Lock { get; set; }
  • 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

public string Scheme { get; set; }
  • Type: string
(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.