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 { SSHProvisionerConnection } from 'cdktn'

const sSHProvisionerConnection: SSHProvisionerConnection = { ... }

Properties

NameTypeDescription
hoststringThe address of the resource to connect to.
typestringThe connection type.
agentstringSet to false to disable using ssh-agent to authenticate.
agentIdentitystringThe preferred identity from the ssh agent for authentication.
bastionCertificatestringThe contents of a signed CA Certificate.
bastionHoststringSetting this enables the bastion Host connection.
bastionHostKeystringThe public key from the remote host or the signing CA, used to verify the host connection.
bastionPasswordstringThe password to use for the bastion host.
bastionPortnumberThe port to use connect to the bastion host.
bastionPrivateKeystringThe contents of an SSH key file to use for the bastion host.
bastionUserstringThe user for the connection to the bastion host.
certificatestringThe contents of a signed CA Certificate.
hostKeystringThe public key from the remote host or the signing CA, used to verify the connection.
passwordstringThe password to use for the connection.
portnumberThe port to connect to.
privateKeystringThe contents of an SSH key to use for the connection.
proxyHoststringSetting this enables the SSH over HTTP connection.
proxyPortnumberThe port to use connect to the proxy host.
proxySchemestringThe ssh connection also supports the following fields to facilitate connections by SSH over HTTP proxy.
proxyUserNamestringThe username to use connect to the private proxy host.
proxyUserPasswordstringThe password to use connect to the private proxy host.
scriptPathstringThe path used to copy scripts meant for remote execution.
targetPlatformstringThe target platform to connect to.
timeoutstringThe timeout to wait for the connection to become available.
userstringThe user to use for the connection.

hostRequired

public readonly host: string;
  • Type: string
The address of the resource to connect to.

typeRequired

public readonly type: string;
  • Type: 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 readonly agent: string;
  • Type: string
Set to false to disable using ssh-agent to authenticate. On Windows the only supported SSH authentication agent is Pageant.

agentIdentityOptional

public readonly agentIdentity: string;
  • Type: string
The preferred identity from the ssh agent for authentication.

bastionCertificateOptional

public readonly bastionCertificate: string;
  • Type: 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 readonly bastionHost: string;
  • Type: 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 readonly bastionHostKey: string;
  • Type: string
The public key from the remote host or the signing CA, used to verify the host connection.

bastionPasswordOptional

public readonly bastionPassword: string;
  • Type: string
The password to use for the bastion host.

bastionPortOptional

public readonly bastionPort: number;
  • Type: number
The port to use connect to the bastion host.

bastionPrivateKeyOptional

public readonly bastionPrivateKey: string;
  • Type: 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 readonly bastionUser: string;
  • Type: string
The user for the connection to the bastion host.

certificateOptional

public readonly certificate: string;
  • Type: 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 readonly hostKey: string;
  • Type: string
The public key from the remote host or the signing CA, used to verify the connection.

passwordOptional

public readonly password: string;
  • Type: string
The password to use for the connection.

portOptional

public readonly port: number;
  • Type: number
  • Default: 22
The port to connect to.

privateKeyOptional

public readonly privateKey: string;
  • Type: 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 readonly proxyHost: string;
  • Type: 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 readonly proxyPort: number;
  • Type: number
The port to use connect to the proxy host.

proxySchemeOptional

public readonly proxyScheme: string;
  • Type: string
The ssh connection also supports the following fields to facilitate connections by SSH over HTTP proxy.

proxyUserNameOptional

public readonly proxyUserName: string;
  • Type: 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 readonly proxyUserPassword: string;
  • Type: 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 readonly scriptPath: string;
  • Type: string
The path used to copy scripts meant for remote execution. Refer to How Provisioners Execute Remote Scripts below for more details

targetPlatformOptional

public readonly targetPlatform: string;
  • Type: 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 readonly timeout: string;
  • Type: 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 readonly user: string;
  • Type: string
  • Default: root
The user to use for the connection.