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 "github.com/open-constructs/cdk-terrain-go/cdktn"

&cdktn.SSHProvisionerConnection {
	Host: *string,
	Type: *string,
	Agent: *string,
	AgentIdentity: *string,
	BastionCertificate: *string,
	BastionHost: *string,
	BastionHostKey: *string,
	BastionPassword: *string,
	BastionPort: *f64,
	BastionPrivateKey: *string,
	BastionUser: *string,
	Certificate: *string,
	HostKey: *string,
	Password: *string,
	Port: *f64,
	PrivateKey: *string,
	ProxyHost: *string,
	ProxyPort: *f64,
	ProxyScheme: *string,
	ProxyUserName: *string,
	ProxyUserPassword: *string,
	ScriptPath: *string,
	TargetPlatform: *string,
	Timeout: *string,
	User: *string,
}

Properties

NameTypeDescription
Host*stringThe address of the resource to connect to.
Type*stringThe connection type.
Agent*stringSet to false to disable using ssh-agent to authenticate.
AgentIdentity*stringThe preferred identity from the ssh agent for authentication.
BastionCertificate*stringThe contents of a signed CA Certificate.
BastionHost*stringSetting this enables the bastion Host connection.
BastionHostKey*stringThe public key from the remote host or the signing CA, used to verify the host connection.
BastionPassword*stringThe password to use for the bastion host.
BastionPort*f64The port to use connect to the bastion host.
BastionPrivateKey*stringThe contents of an SSH key file to use for the bastion host.
BastionUser*stringThe user for the connection to the bastion host.
Certificate*stringThe contents of a signed CA Certificate.
HostKey*stringThe public key from the remote host or the signing CA, used to verify the connection.
Password*stringThe password to use for the connection.
Port*f64The port to connect to.
PrivateKey*stringThe contents of an SSH key to use for the connection.
ProxyHost*stringSetting this enables the SSH over HTTP connection.
ProxyPort*f64The port to use connect to the proxy host.
ProxyScheme*stringThe ssh connection also supports the following fields to facilitate connections by SSH over HTTP proxy.
ProxyUserName*stringThe username to use connect to the private proxy host.
ProxyUserPassword*stringThe password to use connect to the private proxy host.
ScriptPath*stringThe path used to copy scripts meant for remote execution.
TargetPlatform*stringThe target platform to connect to.
Timeout*stringThe timeout to wait for the connection to become available.
User*stringThe user to use for the connection.

HostRequired

Host *string
  • Type: *string
The address of the resource to connect to.

TypeRequired

Type *string
  • 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

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

AgentIdentityOptional

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

BastionCertificateOptional

BastionCertificate *string
  • 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

BastionHost *string
  • 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

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

BastionPasswordOptional

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

BastionPortOptional

BastionPort *f64
  • Type: *f64
The port to use connect to the bastion host.

BastionPrivateKeyOptional

BastionPrivateKey *string
  • 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

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

CertificateOptional

Certificate *string
  • 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

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

PasswordOptional

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

PortOptional

Port *f64
  • Type: *f64
  • Default: 22
The port to connect to.

PrivateKeyOptional

PrivateKey *string
  • 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

ProxyHost *string
  • 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

ProxyPort *f64
  • Type: *f64
The port to use connect to the proxy host.

ProxySchemeOptional

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

ProxyUserNameOptional

ProxyUserName *string
  • 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

ProxyUserPassword *string
  • 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

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

TargetPlatformOptional

TargetPlatform *string
  • 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

Timeout *string
  • 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

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