Skip to main content
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

Initializer

using Io.Cdktn;

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

Properties

NameTypeDescription
DestinationstringThe source file or directory.
TypestringNo description.
ConnectionSSHProvisionerConnection|WinrmProvisionerConnectionMost provisioners require access to the remote resource via SSH or WinRM and expect a nested connection block with details about how to connect.
ContentstringThe destination path to write to on the remote system.
SourcestringThe direct content to copy on the destination.

DestinationRequired

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.

TypeRequired

public string Type { get; set; }
  • Type: string

ConnectionOptional

public SSHProvisionerConnection|WinrmProvisionerConnection Connection { get; set; }
Most provisioners require access to the remote resource via SSH or WinRM and expect a nested connection block with details about how to connect.

ContentOptional

public string Content { get; set; }
  • Type: string
The destination path to write to on the remote system. See Destination Paths below for more information.

SourceOptional

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.