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

Initializer

import io.cdktn.cdktn.SSHProvisionerConnection;

SSHProvisionerConnection.builder()
    .host(java.lang.String)
    .type(java.lang.String)
//  .agent(java.lang.String)
//  .agentIdentity(java.lang.String)
//  .bastionCertificate(java.lang.String)
//  .bastionHost(java.lang.String)
//  .bastionHostKey(java.lang.String)
//  .bastionPassword(java.lang.String)
//  .bastionPort(java.lang.Number)
//  .bastionPrivateKey(java.lang.String)
//  .bastionUser(java.lang.String)
//  .certificate(java.lang.String)
//  .hostKey(java.lang.String)
//  .password(java.lang.String)
//  .port(java.lang.Number)
//  .privateKey(java.lang.String)
//  .proxyHost(java.lang.String)
//  .proxyPort(java.lang.Number)
//  .proxyScheme(java.lang.String)
//  .proxyUserName(java.lang.String)
//  .proxyUserPassword(java.lang.String)
//  .scriptPath(java.lang.String)
//  .targetPlatform(java.lang.String)
//  .timeout(java.lang.String)
//  .user(java.lang.String)
    .build();

Properties

NameTypeDescription
hostjava.lang.StringThe address of the resource to connect to.
typejava.lang.StringThe connection type.
agentjava.lang.StringSet to false to disable using ssh-agent to authenticate.
agentIdentityjava.lang.StringThe preferred identity from the ssh agent for authentication.
bastionCertificatejava.lang.StringThe contents of a signed CA Certificate.
bastionHostjava.lang.StringSetting this enables the bastion Host connection.
bastionHostKeyjava.lang.StringThe public key from the remote host or the signing CA, used to verify the host connection.
bastionPasswordjava.lang.StringThe password to use for the bastion host.
bastionPortjava.lang.NumberThe port to use connect to the bastion host.
bastionPrivateKeyjava.lang.StringThe contents of an SSH key file to use for the bastion host.
bastionUserjava.lang.StringThe user for the connection to the bastion host.
certificatejava.lang.StringThe contents of a signed CA Certificate.
hostKeyjava.lang.StringThe public key from the remote host or the signing CA, used to verify the connection.
passwordjava.lang.StringThe password to use for the connection.
portjava.lang.NumberThe port to connect to.
privateKeyjava.lang.StringThe contents of an SSH key to use for the connection.
proxyHostjava.lang.StringSetting this enables the SSH over HTTP connection.
proxyPortjava.lang.NumberThe port to use connect to the proxy host.
proxySchemejava.lang.StringThe ssh connection also supports the following fields to facilitate connections by SSH over HTTP proxy.
proxyUserNamejava.lang.StringThe username to use connect to the private proxy host.
proxyUserPasswordjava.lang.StringThe password to use connect to the private proxy host.
scriptPathjava.lang.StringThe path used to copy scripts meant for remote execution.
targetPlatformjava.lang.StringThe target platform to connect to.
timeoutjava.lang.StringThe timeout to wait for the connection to become available.
userjava.lang.StringThe user to use for the connection.

hostRequired

public java.lang.String getHost();
  • Type: java.lang.String
The address of the resource to connect to.

typeRequired

public java.lang.String getType();
  • Type: java.lang.String
The connection type. Valid values are “ssh” and “winrm”. Provisioners typically assume that the remote system runs Microsoft Windows when using WinRM. Behaviors based on the SSH target_platform will force Windows-specific behavior for WinRM, unless otherwise specified.

agentOptional

public java.lang.String getAgent();
  • Type: java.lang.String
Set to false to disable using ssh-agent to authenticate. On Windows the only supported SSH authentication agent is Pageant.

agentIdentityOptional

public java.lang.String getAgentIdentity();
  • Type: java.lang.String
The preferred identity from the ssh agent for authentication.

bastionCertificateOptional

public java.lang.String getBastionCertificate();
  • Type: java.lang.String
The contents of a signed CA Certificate. The certificate argument must be used in conjunction with a bastion_private_key. These can be loaded from a file on disk using the the file function.

bastionHostOptional

public java.lang.String getBastionHost();
  • Type: java.lang.String
Setting this enables the bastion Host connection. The provisioner will connect to bastion_host first, and then connect from there to host.

bastionHostKeyOptional

public java.lang.String getBastionHostKey();
  • Type: java.lang.String
The public key from the remote host or the signing CA, used to verify the host connection.

bastionPasswordOptional

public java.lang.String getBastionPassword();
  • Type: java.lang.String
The password to use for the bastion host.

bastionPortOptional

public java.lang.Number getBastionPort();
  • Type: java.lang.Number
The port to use connect to the bastion host.

bastionPrivateKeyOptional

public java.lang.String getBastionPrivateKey();
  • Type: java.lang.String
The contents of an SSH key file to use for the bastion host. These can be loaded from a file on disk using the file function.

bastionUserOptional

public java.lang.String getBastionUser();
  • Type: java.lang.String
The user for the connection to the bastion host.

certificateOptional

public java.lang.String getCertificate();
  • Type: java.lang.String
The contents of a signed CA Certificate. The certificate argument must be used in conjunction with a private_key. These can be loaded from a file on disk using the the file function.

hostKeyOptional

public java.lang.String getHostKey();
  • Type: java.lang.String
The public key from the remote host or the signing CA, used to verify the connection.

passwordOptional

public java.lang.String getPassword();
  • Type: java.lang.String
The password to use for the connection.

portOptional

public java.lang.Number getPort();
  • Type: java.lang.Number
  • Default: 22
The port to connect to.

privateKeyOptional

public java.lang.String getPrivateKey();
  • Type: java.lang.String
The contents of an SSH key to use for the connection. These can be loaded from a file on disk using the file function. This takes preference over password if provided.

proxyHostOptional

public java.lang.String getProxyHost();
  • Type: java.lang.String
Setting this enables the SSH over HTTP connection. This host will be connected to first, and then the host or bastion_host connection will be made from there.

proxyPortOptional

public java.lang.Number getProxyPort();
  • Type: java.lang.Number
The port to use connect to the proxy host.

proxySchemeOptional

public java.lang.String getProxyScheme();
  • Type: java.lang.String
The ssh connection also supports the following fields to facilitate connections by SSH over HTTP proxy.

proxyUserNameOptional

public java.lang.String getProxyUserName();
  • Type: java.lang.String
The username to use connect to the private proxy host. This argument should be specified only if authentication is required for the HTTP Proxy server.

proxyUserPasswordOptional

public java.lang.String getProxyUserPassword();
  • Type: java.lang.String
The password to use connect to the private proxy host. This argument should be specified only if authentication is required for the HTTP Proxy server.

scriptPathOptional

public java.lang.String getScriptPath();
  • Type: java.lang.String
The path used to copy scripts meant for remote execution. Refer to How Provisioners Execute Remote Scripts below for more details

targetPlatformOptional

public java.lang.String getTargetPlatform();
  • Type: java.lang.String
  • Default: unix
The target platform to connect to. Valid values are “windows” and “unix”. If the platform is set to windows, the default script_path is c:\windows\temp\terraform_%RAND%.cmd, assuming the SSH default shell is cmd.exe. If the SSH default shell is PowerShell, set script_path to “c:/windows/temp/terraform_%RAND%.ps1”

timeoutOptional

public java.lang.String getTimeout();
  • Type: java.lang.String
  • Default: 5m
The timeout to wait for the connection to become available. Should be provided as a string (e.g., ”30s” or “5m”.)

userOptional

public java.lang.String getUser();
  • Type: java.lang.String
  • Default: root
The user to use for the connection.