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

# Java: ConsulBackend

> CDKTN Core API Reference for ConsulBackend in Java.

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

```java theme={null}
import io.cdktn.cdktn.ConsulBackend;

ConsulBackend.Builder.create(Construct scope)
    .accessToken(java.lang.String)
    .path(java.lang.String)
//  .address(java.lang.String)
//  .caFile(java.lang.String)
//  .certFile(java.lang.String)
//  .datacenter(java.lang.String)
//  .gzip(java.lang.Boolean)
//  .httpAuth(java.lang.String)
//  .keyFile(java.lang.String)
//  .lock(java.lang.Boolean)
//  .scheme(java.lang.String)
    .build();
```

| **Name**                                                                                      | **Type**                                   | **Description**                                                                                                                        |
| --------------------------------------------------------------------------------------------- | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| <code><a href="#cdktn.ConsulBackend.Initializer.parameter.scope">scope</a></code>             | <code>software.constructs.Construct</code> | *No description.*                                                                                                                      |
| <code><a href="#cdktn.ConsulBackend.Initializer.parameter.accessToken">accessToken</a></code> | <code>java.lang.String</code>              | (Required) Access token.                                                                                                               |
| <code><a href="#cdktn.ConsulBackend.Initializer.parameter.path">path</a></code>               | <code>java.lang.String</code>              | (Required) Path in the Consul KV store.                                                                                                |
| <code><a href="#cdktn.ConsulBackend.Initializer.parameter.address">address</a></code>         | <code>java.lang.String</code>              | (Optional) DNS name and port of your Consul endpoint specified in the format dnsname:port.                                             |
| <code><a href="#cdktn.ConsulBackend.Initializer.parameter.caFile">caFile</a></code>           | <code>java.lang.String</code>              | (Optional) A path to a PEM-encoded certificate authority used to verify the remote agent's certificate.                                |
| <code><a href="#cdktn.ConsulBackend.Initializer.parameter.certFile">certFile</a></code>       | <code>java.lang.String</code>              | (Optional) A path to a PEM-encoded certificate provided to the remote agent;                                                           |
| <code><a href="#cdktn.ConsulBackend.Initializer.parameter.datacenter">datacenter</a></code>   | <code>java.lang.String</code>              | (Optional) The datacenter to use.                                                                                                      |
| <code><a href="#cdktn.ConsulBackend.Initializer.parameter.gzip">gzip</a></code>               | <code>java.lang.Boolean</code>             | (Optional) true to compress the state data using gzip, or false (the default) to leave it uncompressed.                                |
| <code><a href="#cdktn.ConsulBackend.Initializer.parameter.httpAuth">httpAuth</a></code>       | <code>java.lang.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.ConsulBackend.Initializer.parameter.keyFile">keyFile</a></code>         | <code>java.lang.String</code>              | (Optional) A path to a PEM-encoded private key, required if cert\_file is specified.                                                   |
| <code><a href="#cdktn.ConsulBackend.Initializer.parameter.lock">lock</a></code>               | <code>java.lang.Boolean</code>             | (Optional) false to disable locking.                                                                                                   |
| <code><a href="#cdktn.ConsulBackend.Initializer.parameter.scheme">scheme</a></code>           | <code>java.lang.String</code>              | (Optional) Specifies what protocol to use when talking to the given address,either http or https.                                      |

***

### `scope`<sup>Required</sup> <a name="scope" id="cdktn.ConsulBackend.Initializer.parameter.scope" />

* *Type:* software.constructs.Construct

***

### `accessToken`<sup>Required</sup> <a name="accessToken" id="cdktn.ConsulBackend.Initializer.parameter.accessToken" />

* *Type:* java.lang.String

(Required) Access token.

***

### `path`<sup>Required</sup> <a name="path" id="cdktn.ConsulBackend.Initializer.parameter.path" />

* *Type:* java.lang.String

(Required) Path in the Consul KV store.

***

### `address`<sup>Optional</sup> <a name="address" id="cdktn.ConsulBackend.Initializer.parameter.address" />

* *Type:* java.lang.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.ConsulBackend.Initializer.parameter.caFile" />

* *Type:* java.lang.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.ConsulBackend.Initializer.parameter.certFile" />

* *Type:* java.lang.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.ConsulBackend.Initializer.parameter.datacenter" />

* *Type:* java.lang.String

(Optional) The datacenter to use.

Defaults to that of the agent.

***

### `gzip`<sup>Optional</sup> <a name="gzip" id="cdktn.ConsulBackend.Initializer.parameter.gzip" />

* *Type:* java.lang.Boolean

(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.ConsulBackend.Initializer.parameter.httpAuth" />

* *Type:* java.lang.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.ConsulBackend.Initializer.parameter.keyFile" />

* *Type:* java.lang.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.ConsulBackend.Initializer.parameter.lock" />

* *Type:* java.lang.Boolean

(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.ConsulBackend.Initializer.parameter.scheme" />

* *Type:* java.lang.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.

***

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

| **Name**                                                                                          | **Description**                                                                   |
| ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| <code><a href="#cdktn.ConsulBackend.toString">toString</a></code>                                 | Returns a string representation of this construct.                                |
| <code><a href="#cdktn.ConsulBackend.with">with</a></code>                                         | Applies one or more mixins to this construct.                                     |
| <code><a href="#cdktn.ConsulBackend.addOverride">addOverride</a></code>                           | *No description.*                                                                 |
| <code><a href="#cdktn.ConsulBackend.overrideLogicalId">overrideLogicalId</a></code>               | Overrides the auto-generated logical ID with a specific ID.                       |
| <code><a href="#cdktn.ConsulBackend.resetOverrideLogicalId">resetOverrideLogicalId</a></code>     | Resets a previously passed logical Id to use the auto-generated logical id again. |
| <code><a href="#cdktn.ConsulBackend.toHclTerraform">toHclTerraform</a></code>                     | *No description.*                                                                 |
| <code><a href="#cdktn.ConsulBackend.toMetadata">toMetadata</a></code>                             | *No description.*                                                                 |
| <code><a href="#cdktn.ConsulBackend.toTerraform">toTerraform</a></code>                           | Adds this resource to the terraform JSON output.                                  |
| <code><a href="#cdktn.ConsulBackend.getRemoteStateDataSource">getRemoteStateDataSource</a></code> | Creates a TerraformRemoteState resource that accesses this backend.               |

***

### `toString` <a name="toString" id="cdktn.ConsulBackend.toString" />

```java theme={null}
public java.lang.String toString()
```

Returns a string representation of this construct.

### `with` <a name="with" id="cdktn.ConsulBackend.with" />

```java theme={null}
public IConstruct with(IMixin... mixins)
```

Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple `with()` calls if subsequent mixins should apply to added
constructs.

#### `mixins`<sup>Required</sup> <a name="mixins" id="cdktn.ConsulBackend.with.parameter.mixins" />

* *Type:* software.constructs.IMixin...

The mixins to apply.

***

### `addOverride` <a name="addOverride" id="cdktn.ConsulBackend.addOverride" />

```java theme={null}
public void addOverride(java.lang.String path, java.lang.Object value)
```

#### `path`<sup>Required</sup> <a name="path" id="cdktn.ConsulBackend.addOverride.parameter.path" />

* *Type:* java.lang.String

***

#### `value`<sup>Required</sup> <a name="value" id="cdktn.ConsulBackend.addOverride.parameter.value" />

* *Type:* java.lang.Object

***

### `overrideLogicalId` <a name="overrideLogicalId" id="cdktn.ConsulBackend.overrideLogicalId" />

```java theme={null}
public void overrideLogicalId(java.lang.String newLogicalId)
```

Overrides the auto-generated logical ID with a specific ID.

#### `newLogicalId`<sup>Required</sup> <a name="newLogicalId" id="cdktn.ConsulBackend.overrideLogicalId.parameter.newLogicalId" />

* *Type:* java.lang.String

The new logical ID to use for this stack element.

***

### `resetOverrideLogicalId` <a name="resetOverrideLogicalId" id="cdktn.ConsulBackend.resetOverrideLogicalId" />

```java theme={null}
public void resetOverrideLogicalId()
```

Resets a previously passed logical Id to use the auto-generated logical id again.

### `toHclTerraform` <a name="toHclTerraform" id="cdktn.ConsulBackend.toHclTerraform" />

```java theme={null}
public java.lang.Object toHclTerraform()
```

### `toMetadata` <a name="toMetadata" id="cdktn.ConsulBackend.toMetadata" />

```java theme={null}
public java.lang.Object toMetadata()
```

### `toTerraform` <a name="toTerraform" id="cdktn.ConsulBackend.toTerraform" />

```java theme={null}
public java.lang.Object toTerraform()
```

Adds this resource to the terraform JSON output.

### `getRemoteStateDataSource` <a name="getRemoteStateDataSource" id="cdktn.ConsulBackend.getRemoteStateDataSource" />

```java theme={null}
public TerraformRemoteState getRemoteStateDataSource(Construct scope, java.lang.String name, java.lang.String _fromStack)
```

Creates a TerraformRemoteState resource that accesses this backend.

#### `scope`<sup>Required</sup> <a name="scope" id="cdktn.ConsulBackend.getRemoteStateDataSource.parameter.scope" />

* *Type:* software.constructs.Construct

***

#### `name`<sup>Required</sup> <a name="name" id="cdktn.ConsulBackend.getRemoteStateDataSource.parameter.name" />

* *Type:* java.lang.String

***

#### `_fromStack`<sup>Required</sup> <a name="_fromStack" id="cdktn.ConsulBackend.getRemoteStateDataSource.parameter._fromStack" />

* *Type:* java.lang.String

***

## Static Functions <a name="Static Functions" id="Static Functions" />

| **Name**                                                                              | **Description**               |
| ------------------------------------------------------------------------------------- | ----------------------------- |
| <code><a href="#cdktn.ConsulBackend.isConstruct">isConstruct</a></code>               | Checks if `x` is a construct. |
| <code><a href="#cdktn.ConsulBackend.isTerraformElement">isTerraformElement</a></code> | *No description.*             |
| <code><a href="#cdktn.ConsulBackend.isBackend">isBackend</a></code>                   | *No description.*             |

***

### `isConstruct` <a name="isConstruct" id="cdktn.ConsulBackend.isConstruct" />

```java theme={null}
import io.cdktn.cdktn.ConsulBackend;

ConsulBackend.isConstruct(java.lang.Object x)
```

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct`
instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on
disk are seen as independent, completely different libraries. As a
consequence, the class `Construct` in each copy of the `constructs` library
is seen as a different class, and an instance of one class will not test as
`instanceof` the other class. `npm install` will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the `constructs`
library can be accidentally installed, and `instanceof` will behave
unpredictably. It is safest to avoid using `instanceof`, and using
this type-testing method instead.

#### `x`<sup>Required</sup> <a name="x" id="cdktn.ConsulBackend.isConstruct.parameter.x" />

* *Type:* java.lang.Object

Any object.

***

### `isTerraformElement` <a name="isTerraformElement" id="cdktn.ConsulBackend.isTerraformElement" />

```java theme={null}
import io.cdktn.cdktn.ConsulBackend;

ConsulBackend.isTerraformElement(java.lang.Object x)
```

#### `x`<sup>Required</sup> <a name="x" id="cdktn.ConsulBackend.isTerraformElement.parameter.x" />

* *Type:* java.lang.Object

***

### `isBackend` <a name="isBackend" id="cdktn.ConsulBackend.isBackend" />

```java theme={null}
import io.cdktn.cdktn.ConsulBackend;

ConsulBackend.isBackend(java.lang.Object x)
```

#### `x`<sup>Required</sup> <a name="x" id="cdktn.ConsulBackend.isBackend.parameter.x" />

* *Type:* java.lang.Object

***

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

| **Name**                                                                                   | **Type**                                                        | **Description**   |
| ------------------------------------------------------------------------------------------ | --------------------------------------------------------------- | ----------------- |
| <code><a href="#cdktn.ConsulBackend.property.node">node</a></code>                         | <code>software.constructs.Node</code>                           | The tree node.    |
| <code><a href="#cdktn.ConsulBackend.property.cdktfStack">cdktfStack</a></code>             | <code><a href="#cdktn.TerraformStack">TerraformStack</a></code> | *No description.* |
| <code><a href="#cdktn.ConsulBackend.property.fqn">fqn</a></code>                           | <code>java.lang.String</code>                                   | *No description.* |
| <code><a href="#cdktn.ConsulBackend.property.friendlyUniqueId">friendlyUniqueId</a></code> | <code>java.lang.String</code>                                   | *No description.* |

***

### `node`<sup>Required</sup> <a name="node" id="cdktn.ConsulBackend.property.node" />

```java theme={null}
public Node getNode();
```

* *Type:* software.constructs.Node

The tree node.

***

### `cdktfStack`<sup>Required</sup> <a name="cdktfStack" id="cdktn.ConsulBackend.property.cdktfStack" />

```java theme={null}
public TerraformStack getCdktfStack();
```

* *Type:* <a href="#cdktn.TerraformStack">TerraformStack</a>

***

### `fqn`<sup>Required</sup> <a name="fqn" id="cdktn.ConsulBackend.property.fqn" />

```java theme={null}
public java.lang.String getFqn();
```

* *Type:* java.lang.String

***

### `friendlyUniqueId`<sup>Required</sup> <a name="friendlyUniqueId" id="cdktn.ConsulBackend.property.friendlyUniqueId" />

```java theme={null}
public java.lang.String getFriendlyUniqueId();
```

* *Type:* java.lang.String

***
