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

> CDKTN Core API Reference for TerraformSelf in Python.

Expressions in connection blocks cannot refer to their parent resource by name.

References create dependencies, and referring to a resource by name within its own block would create a dependency cycle.
Instead, expressions can use the self object, which represents the connection's parent resource and has all of that resource's attributes.
For example, use self.public\_ip to reference an aws\_instance's public\_ip attribute.

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

```python theme={null}
import cdktn

cdktn.TerraformSelf()
```

| **Name** | **Type** | **Description** |
| -------- | -------- | --------------- |

***

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

| **Name**                                                              | **Description**                                                                     |
| --------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| <code><a href="#cdktn.TerraformSelf.getAny">get\_any</a></code>       | Only usable within a connection block to reference the connections parent resource. |
| <code><a href="#cdktn.TerraformSelf.getNumber">get\_number</a></code> | Only usable within a connection block to reference the connections parent resource. |
| <code><a href="#cdktn.TerraformSelf.getString">get\_string</a></code> | Only usable within a connection block to reference the connections parent resource. |

***

### `get_any` <a name="get_any" id="cdktn.TerraformSelf.getAny" />

```python theme={null}
import cdktn

cdktn.TerraformSelf.get_any(
  key: str
)
```

Only usable within a connection block to reference the connections parent resource.

Access a property on the resource like this: `getAny("hostPort")`

#### `key`<sup>Required</sup> <a name="key" id="cdktn.TerraformSelf.getAny.parameter.key" />

* *Type:* str

***

### `get_number` <a name="get_number" id="cdktn.TerraformSelf.getNumber" />

```python theme={null}
import cdktn

cdktn.TerraformSelf.get_number(
  key: str
)
```

Only usable within a connection block to reference the connections parent resource.

Access a property on the resource like this: `getNumber("hostPort")`

#### `key`<sup>Required</sup> <a name="key" id="cdktn.TerraformSelf.getNumber.parameter.key" />

* *Type:* str

***

### `get_string` <a name="get_string" id="cdktn.TerraformSelf.getString" />

```python theme={null}
import cdktn

cdktn.TerraformSelf.get_string(
  key: str
)
```

Only usable within a connection block to reference the connections parent resource.

Access a property on the resource like this: `getString("publicIp")`

#### `key`<sup>Required</sup> <a name="key" id="cdktn.TerraformSelf.getString.parameter.key" />

* *Type:* str

***
