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

Properties


hostRequired

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

typeRequired

  • 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

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

agent_identityOptional

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

bastion_certificateOptional

  • 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

  • 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

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

bastion_passwordOptional

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

bastion_portOptional

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

bastion_private_keyOptional

  • 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

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

certificateOptional

  • 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

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

passwordOptional

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

portOptional

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

private_keyOptional

  • 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

  • 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

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

proxy_schemeOptional

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

proxy_user_nameOptional

  • 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

  • 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

  • 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

  • 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

  • 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

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