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

# Go: Resource

> CDKTN Core API Reference for Resource in Go.

* *Implements:* <a href="#cdktn.IResource">IResource</a>

A construct which represents a resource.

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

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.NewResource(scope Construct, id *string) Resource
```

| **Name**                                                                     | **Type**                                                           | **Description**   |
| ---------------------------------------------------------------------------- | ------------------------------------------------------------------ | ----------------- |
| <code><a href="#cdktn.Resource.Initializer.parameter.scope">scope</a></code> | <code>github.com/aws/constructs-go/constructs/v10.Construct</code> | *No description.* |
| <code><a href="#cdktn.Resource.Initializer.parameter.id">id</a></code>       | <code>\*string</code>                                              | *No description.* |

***

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

* *Type:* github.com/aws/constructs-go/constructs/v10.Construct

***

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

* *Type:* \*string

***

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

| **Name**                                                     | **Description**                                    |
| ------------------------------------------------------------ | -------------------------------------------------- |
| <code><a href="#cdktn.Resource.toString">ToString</a></code> | Returns a string representation of this construct. |
| <code><a href="#cdktn.Resource.with">With</a></code>         | Applies one or more mixins to this construct.      |

***

### ~~`ToString`~~ <a name="ToString" id="cdktn.Resource.toString" />

```go theme={null}
func ToString() *string
```

Returns a string representation of this construct.

### ~~`With`~~ <a name="With" id="cdktn.Resource.with" />

```go theme={null}
func 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.Resource.with.parameter.mixins" />

* *Type:* ...github.com/aws/constructs-go/constructs/v10.IMixin

The mixins to apply.

***

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

| **Name**                                                           | **Description**               |
| ------------------------------------------------------------------ | ----------------------------- |
| <code><a href="#cdktn.Resource.isConstruct">IsConstruct</a></code> | Checks if `x` is a construct. |

***

### ~~`IsConstruct`~~ <a name="IsConstruct" id="cdktn.Resource.isConstruct" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Resource_IsConstruct(x interface{}) *bool
```

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

* *Type:* interface\{}

Any object.

***

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

| **Name**                                                        | **Type**                                                        | **Description**                              |
| --------------------------------------------------------------- | --------------------------------------------------------------- | -------------------------------------------- |
| <code><a href="#cdktn.Resource.property.node">Node</a></code>   | <code>github.com/aws/constructs-go/constructs/v10.Node</code>   | The tree node.                               |
| <code><a href="#cdktn.Resource.property.stack">Stack</a></code> | <code><a href="#cdktn.TerraformStack">TerraformStack</a></code> | The stack in which this resource is defined. |

***

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

* *Deprecated:* - Please use Construct from the constructs package instead.

```go theme={null}
func Node() Node
```

* *Type:* github.com/aws/constructs-go/constructs/v10.Node

The tree node.

***

### ~~`Stack`~~<sup>Required</sup> <a name="Stack" id="cdktn.Resource.property.stack" />

* *Deprecated:* - Please use Construct from the constructs package instead.

```go theme={null}
func Stack() TerraformStack
```

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

The stack in which this resource is defined.

***
