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

> CDKTN Core API Reference for FileProvisioner in CSharp.

The file provisioner copies files or directories from the machine running Terraform to the newly created resource.

The file provisioner supports both ssh and winrm type connections.

See [file](https://developer.hashicorp.com/terraform/language/resources/provisioners/file)

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

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

new FileProvisioner {
    string Destination,
    string Type,
    SSHProvisionerConnection|WinrmProvisionerConnection Connection = null,
    string Content = null,
    string Source = null
};
```

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

| **Name**                                                                           | **Type**                                                                                                                                                        | **Description**                                                                                                                                  |
| ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| <code><a href="#cdktn.FileProvisioner.property.destination">Destination</a></code> | <code>string</code>                                                                                                                                             | The source file or directory.                                                                                                                    |
| <code><a href="#cdktn.FileProvisioner.property.type">Type</a></code>               | <code>string</code>                                                                                                                                             | *No description.*                                                                                                                                |
| <code><a href="#cdktn.FileProvisioner.property.connection">Connection</a></code>   | <code><a href="#cdktn.SSHProvisionerConnection">SSHProvisionerConnection</a>\|<a href="#cdktn.WinrmProvisionerConnection">WinrmProvisionerConnection</a></code> | Most provisioners require access to the remote resource via SSH or WinRM and expect a nested connection block with details about how to connect. |
| <code><a href="#cdktn.FileProvisioner.property.content">Content</a></code>         | <code>string</code>                                                                                                                                             | The destination path to write to on the remote system.                                                                                           |
| <code><a href="#cdktn.FileProvisioner.property.source">Source</a></code>           | <code>string</code>                                                                                                                                             | The direct content to copy on the destination.                                                                                                   |

***

### `Destination`<sup>Required</sup> <a name="Destination" id="cdktn.FileProvisioner.property.destination" />

```csharp theme={null}
public string Destination { get; set; }
```

* *Type:* string

The source file or directory.

Specify it either relative to the current working directory or as an absolute path.
This argument cannot be combined with content.

***

### `Type`<sup>Required</sup> <a name="Type" id="cdktn.FileProvisioner.property.type" />

```csharp theme={null}
public string Type { get; set; }
```

* *Type:* string

***

### `Connection`<sup>Optional</sup> <a name="Connection" id="cdktn.FileProvisioner.property.connection" />

```csharp theme={null}
public SSHProvisionerConnection|WinrmProvisionerConnection Connection { get; set; }
```

* *Type:* <a href="#cdktn.SSHProvisionerConnection">SSHProvisionerConnection</a>|<a href="#cdktn.WinrmProvisionerConnection">WinrmProvisionerConnection</a>

Most provisioners require access to the remote resource via SSH or WinRM and expect a nested connection block with details about how to connect.

***

### `Content`<sup>Optional</sup> <a name="Content" id="cdktn.FileProvisioner.property.content" />

```csharp theme={null}
public string Content { get; set; }
```

* *Type:* string

The destination path to write to on the remote system.

See Destination Paths below for more information.

***

### `Source`<sup>Optional</sup> <a name="Source" id="cdktn.FileProvisioner.property.source" />

```csharp theme={null}
public string Source { get; set; }
```

* *Type:* string

The direct content to copy on the destination.

If destination is a file, the content will be written on that file.
In case of a directory, a file named tf-file-content is created inside that directory.
We recommend using a file as the destination when using content.
This argument cannot be combined with source.

***
