> ## 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: LocalBackend

> CDKTN Core API Reference for LocalBackend in Java.

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

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

LocalBackend.Builder.create(Construct scope)
//  .path(java.lang.String)
//  .workspaceDir(java.lang.String)
    .build();
```

| **Name**                                                                                       | **Type**                                   | **Description**                                |
| ---------------------------------------------------------------------------------------------- | ------------------------------------------ | ---------------------------------------------- |
| <code><a href="#cdktn.LocalBackend.Initializer.parameter.scope">scope</a></code>               | <code>software.constructs.Construct</code> | *No description.*                              |
| <code><a href="#cdktn.LocalBackend.Initializer.parameter.path">path</a></code>                 | <code>java.lang.String</code>              | Path where the state file is stored.           |
| <code><a href="#cdktn.LocalBackend.Initializer.parameter.workspaceDir">workspaceDir</a></code> | <code>java.lang.String</code>              | (Optional) The path to non-default workspaces. |

***

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

* *Type:* software.constructs.Construct

***

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

* *Type:* java.lang.String
* *Default:* defaults to terraform.\$\{stackId}.tfstate

Path where the state file is stored.

***

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

* *Type:* java.lang.String

(Optional) The path to non-default workspaces.

***

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

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

***

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

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

Returns a string representation of this construct.

### `with` <a name="with" id="cdktn.LocalBackend.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.LocalBackend.with.parameter.mixins" />

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

The mixins to apply.

***

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

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

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

* *Type:* java.lang.String

***

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

* *Type:* java.lang.Object

***

### `overrideLogicalId` <a name="overrideLogicalId" id="cdktn.LocalBackend.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.LocalBackend.overrideLogicalId.parameter.newLogicalId" />

* *Type:* java.lang.String

The new logical ID to use for this stack element.

***

### `resetOverrideLogicalId` <a name="resetOverrideLogicalId" id="cdktn.LocalBackend.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.LocalBackend.toHclTerraform" />

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

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

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

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

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

Adds this resource to the terraform JSON output.

### `getRemoteStateDataSource` <a name="getRemoteStateDataSource" id="cdktn.LocalBackend.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.LocalBackend.getRemoteStateDataSource.parameter.scope" />

* *Type:* software.constructs.Construct

***

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

* *Type:* java.lang.String

***

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

* *Type:* java.lang.String

***

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

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

***

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

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

LocalBackend.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.LocalBackend.isConstruct.parameter.x" />

* *Type:* java.lang.Object

Any object.

***

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

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

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

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

* *Type:* java.lang.Object

***

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

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

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

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

* *Type:* java.lang.Object

***

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

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

***

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

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

* *Type:* software.constructs.Node

The tree node.

***

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

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

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

***

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

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

* *Type:* java.lang.String

***

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

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

* *Type:* java.lang.String

***
