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: double
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: double
  • 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: double
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.