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: string
The address of the resource to connect to.

typeRequired

  • 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

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

agentIdentityOptional

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

bastionCertificateOptional

  • 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

  • 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

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

bastionPasswordOptional

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

bastionPortOptional

  • Type: number
The port to use connect to the bastion host.

bastionPrivateKeyOptional

  • 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

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

certificateOptional

  • 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

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

passwordOptional

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

portOptional

  • Type: number
  • Default: 22
The port to connect to.

privateKeyOptional

  • 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

  • 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

  • Type: number
The port to use connect to the proxy host.

proxySchemeOptional

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

proxyUserNameOptional

  • 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

  • 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

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

targetPlatformOptional

  • 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

  • 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

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