> ## Documentation Index
> Fetch the complete documentation index at: https://cdktn.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Go: ConsulBackendConfig

> CDKTN Core API Reference for ConsulBackendConfig in Go.

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](https://developer.hashicorp.com/terraform/language/settings/backends/consul)

## Initializer <a name="Initializer" id="cdktn.ConsulBackendConfig.Initializer" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

&cdktn.ConsulBackendConfig {
	AccessToken: *string,
	Path: *string,
	Address: *string,
	CaFile: *string,
	CertFile: *string,
	Datacenter: *string,
	Gzip: *bool,
	HttpAuth: *string,
	KeyFile: *string,
	Lock: *bool,
	Scheme: *string,
}
```

## Properties <a name="Properties" id="Properties" />

| **Name**                                                                               | **Type**              | **Description**                                                                                                                        |
| -------------------------------------------------------------------------------------- | --------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| <code><a href="#cdktn.ConsulBackendConfig.property.accessToken">AccessToken</a></code> | <code>\*string</code> | (Required) Access token.                                                                                                               |
| <code><a href="#cdktn.ConsulBackendConfig.property.path">Path</a></code>               | <code>\*string</code> | (Required) Path in the Consul KV store.                                                                                                |
| <code><a href="#cdktn.ConsulBackendConfig.property.address">Address</a></code>         | <code>\*string</code> | (Optional) DNS name and port of your Consul endpoint specified in the format dnsname:port.                                             |
| <code><a href="#cdktn.ConsulBackendConfig.property.caFile">CaFile</a></code>           | <code>\*string</code> | (Optional) A path to a PEM-encoded certificate authority used to verify the remote agent's certificate.                                |
| <code><a href="#cdktn.ConsulBackendConfig.property.certFile">CertFile</a></code>       | <code>\*string</code> | (Optional) A path to a PEM-encoded certificate provided to the remote agent;                                                           |
| <code><a href="#cdktn.ConsulBackendConfig.property.datacenter">Datacenter</a></code>   | <code>\*string</code> | (Optional) The datacenter to use.                                                                                                      |
| <code><a href="#cdktn.ConsulBackendConfig.property.gzip">Gzip</a></code>               | <code>\*bool</code>   | (Optional) true to compress the state data using gzip, or false (the default) to leave it uncompressed.                                |
| <code><a href="#cdktn.ConsulBackendConfig.property.httpAuth">HttpAuth</a></code>       | <code>\*string</code> | (Optional) HTTP Basic Authentication credentials to be used when communicating with Consul, in the format of either user or user:pass. |
| <code><a href="#cdktn.ConsulBackendConfig.property.keyFile">KeyFile</a></code>         | <code>\*string</code> | (Optional) A path to a PEM-encoded private key, required if cert\_file is specified.                                                   |
| <code><a href="#cdktn.ConsulBackendConfig.property.lock">Lock</a></code>               | <code>\*bool</code>   | (Optional) false to disable locking.                                                                                                   |
| <code><a href="#cdktn.ConsulBackendConfig.property.scheme">Scheme</a></code>           | <code>\*string</code> | (Optional) Specifies what protocol to use when talking to the given address,either http or https.                                      |

***

### `AccessToken`<sup>Required</sup> <a name="AccessToken" id="cdktn.ConsulBackendConfig.property.accessToken" />

```go theme={null}
AccessToken *string
```

* *Type:* \*string

(Required) Access token.

***

### `Path`<sup>Required</sup> <a name="Path" id="cdktn.ConsulBackendConfig.property.path" />

```go theme={null}
Path *string
```

* *Type:* \*string

(Required) Path in the Consul KV store.

***

### `Address`<sup>Optional</sup> <a name="Address" id="cdktn.ConsulBackendConfig.property.address" />

```go theme={null}
Address *string
```

* *Type:* \*string

(Optional) DNS name and port of your Consul endpoint specified in the format dnsname:port.

Defaults to the local agent HTTP listener.

***

### `CaFile`<sup>Optional</sup> <a name="CaFile" id="cdktn.ConsulBackendConfig.property.caFile" />

```go theme={null}
CaFile *string
```

* *Type:* \*string

(Optional) A path to a PEM-encoded certificate authority used to verify the remote agent's certificate.

***

### `CertFile`<sup>Optional</sup> <a name="CertFile" id="cdktn.ConsulBackendConfig.property.certFile" />

```go theme={null}
CertFile *string
```

* *Type:* \*string

(Optional) A path to a PEM-encoded certificate provided to the remote agent;

requires use of key\_file.

***

### `Datacenter`<sup>Optional</sup> <a name="Datacenter" id="cdktn.ConsulBackendConfig.property.datacenter" />

```go theme={null}
Datacenter *string
```

* *Type:* \*string

(Optional) The datacenter to use.

Defaults to that of the agent.

***

### `Gzip`<sup>Optional</sup> <a name="Gzip" id="cdktn.ConsulBackendConfig.property.gzip" />

```go theme={null}
Gzip *bool
```

* *Type:* \*bool

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

***

### `HttpAuth`<sup>Optional</sup> <a name="HttpAuth" id="cdktn.ConsulBackendConfig.property.httpAuth" />

```go theme={null}
HttpAuth *string
```

* *Type:* \*string

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

***

### `KeyFile`<sup>Optional</sup> <a name="KeyFile" id="cdktn.ConsulBackendConfig.property.keyFile" />

```go theme={null}
KeyFile *string
```

* *Type:* \*string

(Optional) A path to a PEM-encoded private key, required if cert\_file is specified.

***

### `Lock`<sup>Optional</sup> <a name="Lock" id="cdktn.ConsulBackendConfig.property.lock" />

```go theme={null}
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.

***

### `Scheme`<sup>Optional</sup> <a name="Scheme" id="cdktn.ConsulBackendConfig.property.scheme" />

```go theme={null}
Scheme *string
```

* *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.

***
