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

# CSharp: Resource

> CDKTN Core API Reference for Resource in CSharp.

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

A construct which represents a resource.

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

```csharp theme={null}
using Io.Cdktn;

new Resource(Construct Scope, string Id);
```

| **Name**                                                                     | **Type**                          | **Description**   |
| ---------------------------------------------------------------------------- | --------------------------------- | ----------------- |
| <code><a href="#cdktn.Resource.Initializer.parameter.scope">Scope</a></code> | <code>Constructs.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:* Constructs.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" />

```csharp theme={null}
private string ToString()
```

Returns a string representation of this construct.

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

```csharp theme={null}
private IConstruct With(params 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.Resource.with.parameter.mixins" />

* *Type:* params Constructs.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" />

```csharp theme={null}
using Io.Cdktn;

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

* *Type:* object

Any object.

***

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

| **Name**                                                        | **Type**                                                        | **Description**                              |
| --------------------------------------------------------------- | --------------------------------------------------------------- | -------------------------------------------- |
| <code><a href="#cdktn.Resource.property.node">Node</a></code>   | <code>Constructs.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.

```csharp theme={null}
public Node Node { get; }
```

* *Type:* Constructs.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.

```csharp theme={null}
public TerraformStack Stack { get; }
```

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

The stack in which this resource is defined.

***
