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 cdktn

cdktn.SSHProvisionerConnection(
  host: str,
  type: str,
  agent: str = None,
  agent_identity: str = None,
  bastion_certificate: str = None,
  bastion_host: str = None,
  bastion_host_key: str = None,
  bastion_password: str = None,
  bastion_port: typing.Union[int, float] = None,
  bastion_private_key: str = None,
  bastion_user: str = None,
  certificate: str = None,
  host_key: str = None,
  password: str = None,
  port: typing.Union[int, float] = None,
  private_key: str = None,
  proxy_host: str = None,
  proxy_port: typing.Union[int, float] = None,
  proxy_scheme: str = None,
  proxy_user_name: str = None,
  proxy_user_password: str = None,
  script_path: str = None,
  target_platform: str = None,
  timeout: str = None,
  user: str = None
)

Properties

NameTypeDescription
hoststrThe address of the resource to connect to.
typestrThe connection type.
agentstrSet to false to disable using ssh-agent to authenticate.
agent_identitystrThe preferred identity from the ssh agent for authentication.
bastion_certificatestrThe contents of a signed CA Certificate.
bastion_hoststrSetting this enables the bastion Host connection.
bastion_host_keystrThe public key from the remote host or the signing CA, used to verify the host connection.
bastion_passwordstrThe password to use for the bastion host.
bastion_porttyping.Union[int, float]The port to use connect to the bastion host.
bastion_private_keystrThe contents of an SSH key file to use for the bastion host.
bastion_userstrThe user for the connection to the bastion host.
certificatestrThe contents of a signed CA Certificate.
host_keystrThe public key from the remote host or the signing CA, used to verify the connection.
passwordstrThe password to use for the connection.
porttyping.Union[int, float]The port to connect to.
private_keystrThe contents of an SSH key to use for the connection.
proxy_hoststrSetting this enables the SSH over HTTP connection.
proxy_porttyping.Union[int, float]The port to use connect to the proxy host.
proxy_schemestrThe ssh connection also supports the following fields to facilitate connections by SSH over HTTP proxy.
proxy_user_namestrThe username to use connect to the private proxy host.
proxy_user_passwordstrThe password to use connect to the private proxy host.
script_pathstrThe path used to copy scripts meant for remote execution.
target_platformstrThe target platform to connect to.
timeoutstrThe timeout to wait for the connection to become available.
userstrThe user to use for the connection.

hostRequired

host: str
  • Type: str
The address of the resource to connect to.

typeRequired

type: str
  • Type: str
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

agent: str
  • Type: str
Set to false to disable using ssh-agent to authenticate. On Windows the only supported SSH authentication agent is Pageant.

agent_identityOptional

agent_identity: str
  • Type: str
The preferred identity from the ssh agent for authentication.

bastion_certificateOptional

bastion_certificate: str
  • Type: str
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.

bastion_hostOptional

bastion_host: str
  • Type: str
Setting this enables the bastion Host connection. The provisioner will connect to bastion_host first, and then connect from there to host.

bastion_host_keyOptional

bastion_host_key: str
  • Type: str
The public key from the remote host or the signing CA, used to verify the host connection.

bastion_passwordOptional

bastion_password: str
  • Type: str
The password to use for the bastion host.

bastion_portOptional

bastion_port: typing.Union[int, float]
  • Type: typing.Union[int, float]
The port to use connect to the bastion host.

bastion_private_keyOptional

bastion_private_key: str
  • Type: str
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.

bastion_userOptional

bastion_user: str
  • Type: str
The user for the connection to the bastion host.

certificateOptional

certificate: str
  • Type: str
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.

host_keyOptional

host_key: str
  • Type: str
The public key from the remote host or the signing CA, used to verify the connection.

passwordOptional

password: str
  • Type: str
The password to use for the connection.

portOptional

port: typing.Union[int, float]
  • Type: typing.Union[int, float]
  • Default: 22
The port to connect to.

private_keyOptional

private_key: str
  • Type: str
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.

proxy_hostOptional

proxy_host: str
  • Type: str
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.

proxy_portOptional

proxy_port: typing.Union[int, float]
  • Type: typing.Union[int, float]
The port to use connect to the proxy host.

proxy_schemeOptional

proxy_scheme: str
  • Type: str
The ssh connection also supports the following fields to facilitate connections by SSH over HTTP proxy.

proxy_user_nameOptional

proxy_user_name: str
  • Type: str
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.

proxy_user_passwordOptional

proxy_user_password: str
  • Type: str
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.

script_pathOptional

script_path: str
  • Type: str
The path used to copy scripts meant for remote execution. Refer to How Provisioners Execute Remote Scripts below for more details

target_platformOptional

target_platform: str
  • Type: str
  • 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

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

userOptional

user: str
  • Type: str
  • Default: root
The user to use for the connection.