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 io.cdktn.cdktn.FileProvisioner;

FileProvisioner.builder()
    .destination(java.lang.String)
    .type(java.lang.String)
//  .connection(SSHProvisionerConnection|WinrmProvisionerConnection)
//  .content(java.lang.String)
//  .source(java.lang.String)
    .build();

Properties

NameTypeDescription
destinationjava.lang.StringThe source file or directory.
typejava.lang.StringNo 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.
contentjava.lang.StringThe destination path to write to on the remote system.
sourcejava.lang.StringThe direct content to copy on the destination.

destinationRequired

public java.lang.String getDestination();
  • Type: java.lang.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 java.lang.String getType();
  • Type: java.lang.String

connectionOptional

public SSHProvisionerConnection|WinrmProvisionerConnection getConnection();
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 java.lang.String getContent();
  • Type: java.lang.String
The destination path to write to on the remote system. See Destination Paths below for more information.

sourceOptional

public java.lang.String getSource();
  • Type: java.lang.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.