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

import { FileProvisioner } from 'cdktn'

const fileProvisioner: FileProvisioner = { ... }

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

typeRequired

public readonly type: string;
  • Type: string

connectionOptional

public readonly connection: SSHProvisionerConnection | WinrmProvisionerConnection;
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 readonly content: string;
  • Type: string
The destination path to write to on the remote system. See Destination Paths below for more information.

sourceOptional

public readonly 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.