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

# Typescript: TerraformSelf

> CDKTN Core API Reference for TerraformSelf in Typescript.

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" />

```typescript theme={null}
import { TerraformSelf } from 'cdktn'

new TerraformSelf()
```

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

***

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

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

***

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

```typescript theme={null}
import { TerraformSelf } from 'cdktn'

TerraformSelf.getAny(key: string)
```

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:* string

***

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

```typescript theme={null}
import { TerraformSelf } from 'cdktn'

TerraformSelf.getNumber(key: string)
```

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:* string

***

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

```typescript theme={null}
import { TerraformSelf } from 'cdktn'

TerraformSelf.getString(key: string)
```

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:* string

***
