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

# Python: TerraformStack

> CDKTN Core API Reference for TerraformStack in Python.

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

```python theme={null}
import cdktn

cdktn.TerraformStack(
  scope: Construct,
  id: str
)
```

| **Name**                                                                           | **Type**                          | **Description**   |
| ---------------------------------------------------------------------------------- | --------------------------------- | ----------------- |
| <code><a href="#cdktn.TerraformStack.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
| <code><a href="#cdktn.TerraformStack.Initializer.parameter.id">id</a></code>       | <code>str</code>                  | *No description.* |

***

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

* *Type:* constructs.Construct

***

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

* *Type:* str

***

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

| **Name**                                                                                                                         | **Description**                                    |
| -------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| <code><a href="#cdktn.TerraformStack.toString">to\_string</a></code>                                                             | Returns a string representation of this construct. |
| <code><a href="#cdktn.TerraformStack.with">with</a></code>                                                                       | Applies one or more mixins to this construct.      |
| <code><a href="#cdktn.TerraformStack.addDependency">add\_dependency</a></code>                                                   | *No description.*                                  |
| <code><a href="#cdktn.TerraformStack.addOverride">add\_override</a></code>                                                       | *No description.*                                  |
| <code><a href="#cdktn.TerraformStack.allProviders">all\_providers</a></code>                                                     | *No description.*                                  |
| <code><a href="#cdktn.TerraformStack.dependsOn">depends\_on</a></code>                                                           | *No description.*                                  |
| <code><a href="#cdktn.TerraformStack.ensureBackendExists">ensure\_backend\_exists</a></code>                                     | *No description.*                                  |
| <code><a href="#cdktn.TerraformStack.getLogicalId">get\_logical\_id</a></code>                                                   | *No description.*                                  |
| <code><a href="#cdktn.TerraformStack.hasResourceMove">has\_resource\_move</a></code>                                             | *No description.*                                  |
| <code><a href="#cdktn.TerraformStack.prepareStack">prepare\_stack</a></code>                                                     | *No description.*                                  |
| <code><a href="#cdktn.TerraformStack.registerIncomingCrossStackReference">register\_incoming\_cross\_stack\_reference</a></code> | *No description.*                                  |
| <code><a href="#cdktn.TerraformStack.registerOutgoingCrossStackReference">register\_outgoing\_cross\_stack\_reference</a></code> | *No description.*                                  |
| <code><a href="#cdktn.TerraformStack.runAllValidations">run\_all\_validations</a></code>                                         | Run all validations on the stack.                  |
| <code><a href="#cdktn.TerraformStack.toHclTerraform">to\_hcl\_terraform</a></code>                                               | *No description.*                                  |
| <code><a href="#cdktn.TerraformStack.toTerraform">to\_terraform</a></code>                                                       | *No description.*                                  |

***

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

```python theme={null}
def to_string() -> str
```

Returns a string representation of this construct.

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

```python theme={null}
def with(
  mixins: *IMixin
) -> IConstruct
```

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.TerraformStack.with.parameter.mixins" />

* *Type:* \*constructs.IMixin

The mixins to apply.

***

### `add_dependency` <a name="add_dependency" id="cdktn.TerraformStack.addDependency" />

```python theme={null}
def add_dependency(
  dependency: TerraformStack
) -> None
```

#### `dependency`<sup>Required</sup> <a name="dependency" id="cdktn.TerraformStack.addDependency.parameter.dependency" />

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

***

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

```python theme={null}
def add_override(
  path: str,
  value: typing.Any
) -> None
```

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

* *Type:* str

***

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

* *Type:* typing.Any

***

### `all_providers` <a name="all_providers" id="cdktn.TerraformStack.allProviders" />

```python theme={null}
def all_providers() -> typing.List[TerraformProvider]
```

### `depends_on` <a name="depends_on" id="cdktn.TerraformStack.dependsOn" />

```python theme={null}
def depends_on(
  stack: TerraformStack
) -> bool
```

#### `stack`<sup>Required</sup> <a name="stack" id="cdktn.TerraformStack.dependsOn.parameter.stack" />

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

***

### `ensure_backend_exists` <a name="ensure_backend_exists" id="cdktn.TerraformStack.ensureBackendExists" />

```python theme={null}
def ensure_backend_exists() -> TerraformBackend
```

### `get_logical_id` <a name="get_logical_id" id="cdktn.TerraformStack.getLogicalId" />

```python theme={null}
def get_logical_id(
  tf_element: Node | TerraformElement
) -> str
```

#### `tf_element`<sup>Required</sup> <a name="tf_element" id="cdktn.TerraformStack.getLogicalId.parameter.tfElement" />

* *Type:* constructs.Node | <a href="#cdktn.TerraformElement">TerraformElement</a>

***

### `has_resource_move` <a name="has_resource_move" id="cdktn.TerraformStack.hasResourceMove" />

```python theme={null}
def has_resource_move() -> bool
```

### `prepare_stack` <a name="prepare_stack" id="cdktn.TerraformStack.prepareStack" />

```python theme={null}
def prepare_stack() -> None
```

### `register_incoming_cross_stack_reference` <a name="register_incoming_cross_stack_reference" id="cdktn.TerraformStack.registerIncomingCrossStackReference" />

```python theme={null}
def register_incoming_cross_stack_reference(
  from_stack: TerraformStack
) -> TerraformRemoteState
```

#### `from_stack`<sup>Required</sup> <a name="from_stack" id="cdktn.TerraformStack.registerIncomingCrossStackReference.parameter.fromStack" />

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

***

### `register_outgoing_cross_stack_reference` <a name="register_outgoing_cross_stack_reference" id="cdktn.TerraformStack.registerOutgoingCrossStackReference" />

```python theme={null}
def register_outgoing_cross_stack_reference(
  identifier: str
) -> TerraformOutput
```

#### `identifier`<sup>Required</sup> <a name="identifier" id="cdktn.TerraformStack.registerOutgoingCrossStackReference.parameter.identifier" />

* *Type:* str

***

### `run_all_validations` <a name="run_all_validations" id="cdktn.TerraformStack.runAllValidations" />

```python theme={null}
def run_all_validations() -> None
```

Run all validations on the stack.

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

```python theme={null}
def to_hcl_terraform() -> typing.Mapping[typing.Any]
```

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

```python theme={null}
def to_terraform() -> typing.Any
```

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

| **Name**                                                                   | **Description**               |
| -------------------------------------------------------------------------- | ----------------------------- |
| <code><a href="#cdktn.TerraformStack.isConstruct">is\_construct</a></code> | Checks if `x` is a construct. |
| <code><a href="#cdktn.TerraformStack.isStack">is\_stack</a></code>         | *No description.*             |
| <code><a href="#cdktn.TerraformStack.of">of</a></code>                     | *No description.*             |

***

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

```python theme={null}
import cdktn

cdktn.TerraformStack.is_construct(
  x: typing.Any
)
```

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

* *Type:* typing.Any

Any object.

***

### `is_stack` <a name="is_stack" id="cdktn.TerraformStack.isStack" />

```python theme={null}
import cdktn

cdktn.TerraformStack.is_stack(
  x: typing.Any
)
```

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

* *Type:* typing.Any

***

### `of` <a name="of" id="cdktn.TerraformStack.of" />

```python theme={null}
import cdktn

cdktn.TerraformStack.of(
  construct: IConstruct
)
```

#### `construct`<sup>Required</sup> <a name="construct" id="cdktn.TerraformStack.of.parameter.construct" />

* *Type:* constructs.IConstruct

***

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

| **Name**                                                                            | **Type**                                                                            | **Description**   |
| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------- |
| <code><a href="#cdktn.TerraformStack.property.node">node</a></code>                 | <code>constructs.Node</code>                                                        | The tree node.    |
| <code><a href="#cdktn.TerraformStack.property.dependencies">dependencies</a></code> | <code>typing.List\[<a href="#cdktn.TerraformStack">TerraformStack</a>]</code>       | *No description.* |
| <code><a href="#cdktn.TerraformStack.property.moveTargets">move\_targets</a></code> | <code><a href="#cdktn.TerraformResourceTargets">TerraformResourceTargets</a></code> | *No description.* |
| <code><a href="#cdktn.TerraformStack.property.synthesizer">synthesizer</a></code>   | <code><a href="#cdktn.IStackSynthesizer">IStackSynthesizer</a></code>               | *No description.* |

***

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

```python theme={null}
node: Node
```

* *Type:* constructs.Node

The tree node.

***

### `dependencies`<sup>Required</sup> <a name="dependencies" id="cdktn.TerraformStack.property.dependencies" />

```python theme={null}
dependencies: typing.List[TerraformStack]
```

* *Type:* typing.List\[<a href="#cdktn.TerraformStack">TerraformStack</a>]

***

### `move_targets`<sup>Required</sup> <a name="move_targets" id="cdktn.TerraformStack.property.moveTargets" />

```python theme={null}
move_targets: TerraformResourceTargets
```

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

***

### `synthesizer`<sup>Required</sup> <a name="synthesizer" id="cdktn.TerraformStack.property.synthesizer" />

```python theme={null}
synthesizer: IStackSynthesizer
```

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

***
