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

> CDKTN Core API Reference for FileProvisioner in Go.

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

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

&cdktn.FileProvisioner {
	Destination: *string,
	Type: *string,
	Connection: interface{},
	Content: *string,
	Source: *string,
}
```

## 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>interface\{}</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" />

```go theme={null}
Destination *string
```

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

```go theme={null}
Type *string
```

* *Type:* \*string

***

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

```go theme={null}
Connection interface{}
```

* *Type:* interface\{}

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

```go theme={null}
Content *string
```

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

```go theme={null}
Source *string
```

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

***
