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

using Io.Cdktn;

new SSHProvisionerConnection {
    string Host,
    string Type,
    string Agent = null,
    string AgentIdentity = null,
    string BastionCertificate = null,
    string BastionHost = null,
    string BastionHostKey = null,
    string BastionPassword = null,
    double BastionPort = null,
    string BastionPrivateKey = null,
    string BastionUser = null,
    string Certificate = null,
    string HostKey = null,
    string Password = null,
    double Port = null,
    string PrivateKey = null,
    string ProxyHost = null,
    double ProxyPort = null,
    string ProxyScheme = null,
    string ProxyUserName = null,
    string ProxyUserPassword = null,
    string ScriptPath = null,
    string TargetPlatform = null,
    string Timeout = null,
    string User = null
};

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.
BastionPortdoubleThe 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.
PortdoubleThe port to connect to.
PrivateKeystringThe contents of an SSH key to use for the connection.
ProxyHoststringSetting this enables the SSH over HTTP connection.
ProxyPortdoubleThe 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 string Host { get; set; }
  • Type: string
The address of the resource to connect to.

TypeRequired

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

AgentIdentityOptional

public string AgentIdentity { get; set; }
  • Type: string
The preferred identity from the ssh agent for authentication.

BastionCertificateOptional

public string BastionCertificate { get; set; }
  • 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 string BastionHost { get; set; }
  • 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 string BastionHostKey { get; set; }
  • Type: string
The public key from the remote host or the signing CA, used to verify the host connection.

BastionPasswordOptional

public string BastionPassword { get; set; }
  • Type: string
The password to use for the bastion host.

BastionPortOptional

public double BastionPort { get; set; }
  • Type: double
The port to use connect to the bastion host.

BastionPrivateKeyOptional

public string BastionPrivateKey { get; set; }
  • 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 string BastionUser { get; set; }
  • Type: string
The user for the connection to the bastion host.

CertificateOptional

public string Certificate { get; set; }
  • 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 string HostKey { get; set; }
  • Type: string
The public key from the remote host or the signing CA, used to verify the connection.

PasswordOptional

public string Password { get; set; }
  • Type: string
The password to use for the connection.

PortOptional

public double Port { get; set; }
  • Type: double
  • Default: 22
The port to connect to.

PrivateKeyOptional

public string PrivateKey { get; set; }
  • 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 string ProxyHost { get; set; }
  • 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 double ProxyPort { get; set; }
  • Type: double
The port to use connect to the proxy host.

ProxySchemeOptional

public string ProxyScheme { get; set; }
  • Type: string
The ssh connection also supports the following fields to facilitate connections by SSH over HTTP proxy.

ProxyUserNameOptional

public string ProxyUserName { get; set; }
  • 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 string ProxyUserPassword { get; set; }
  • 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 string ScriptPath { get; set; }
  • 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 string TargetPlatform { get; set; }
  • 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 string Timeout { get; set; }
  • 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 string User { get; set; }
  • Type: string
  • Default: root
The user to use for the connection.