Package com.hashicorp.cdktf
Class SSHProvisionerConnection.Builder
java.lang.Object
com.hashicorp.cdktf.SSHProvisionerConnection.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<SSHProvisionerConnection>
- Enclosing interface:
SSHProvisionerConnection
@Stability(Experimental)
public static final class SSHProvisionerConnection.Builder
extends Object
implements software.amazon.jsii.Builder<SSHProvisionerConnection>
A builder for
SSHProvisionerConnection
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the value ofSSHProvisionerConnection.getAgent()
agentIdentity
(String agentIdentity) Sets the value ofSSHProvisionerConnection.getAgentIdentity()
bastionCertificate
(String bastionCertificate) Sets the value ofSSHProvisionerConnection.getBastionCertificate()
bastionHost
(String bastionHost) Sets the value ofSSHProvisionerConnection.getBastionHost()
bastionHostKey
(String bastionHostKey) Sets the value ofSSHProvisionerConnection.getBastionHostKey()
bastionPassword
(String bastionPassword) Sets the value ofSSHProvisionerConnection.getBastionPassword()
bastionPort
(Number bastionPort) Sets the value ofSSHProvisionerConnection.getBastionPort()
bastionPrivateKey
(String bastionPrivateKey) Sets the value ofSSHProvisionerConnection.getBastionPrivateKey()
bastionUser
(String bastionUser) Sets the value ofSSHProvisionerConnection.getBastionUser()
build()
Builds the configured instance.certificate
(String certificate) Sets the value ofSSHProvisionerConnection.getCertificate()
Sets the value ofSSHProvisionerConnection.getHost()
Sets the value ofSSHProvisionerConnection.getHostKey()
Sets the value ofSSHProvisionerConnection.getPassword()
Sets the value ofSSHProvisionerConnection.getPort()
privateKey
(String privateKey) Sets the value ofSSHProvisionerConnection.getPrivateKey()
Sets the value ofSSHProvisionerConnection.getProxyHost()
Sets the value ofSSHProvisionerConnection.getProxyPort()
proxyScheme
(String proxyScheme) Sets the value ofSSHProvisionerConnection.getProxyScheme()
proxyUserName
(String proxyUserName) Sets the value ofSSHProvisionerConnection.getProxyUserName()
proxyUserPassword
(String proxyUserPassword) Sets the value ofSSHProvisionerConnection.getProxyUserPassword()
scriptPath
(String scriptPath) Sets the value ofSSHProvisionerConnection.getScriptPath()
targetPlatform
(String targetPlatform) Sets the value ofSSHProvisionerConnection.getTargetPlatform()
Sets the value ofSSHProvisionerConnection.getTimeout()
Sets the value ofSSHProvisionerConnection.getType()
Sets the value ofSSHProvisionerConnection.getUser()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
host
Sets the value ofSSHProvisionerConnection.getHost()
- Parameters:
host
- The address of the resource to connect to. This parameter is required.- Returns:
this
-
type
Sets the value ofSSHProvisionerConnection.getType()
- Parameters:
type
- The connection type. This parameter is required. 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.- Returns:
this
-
agent
Sets the value ofSSHProvisionerConnection.getAgent()
- Parameters:
agent
- Set to false to disable using ssh-agent to authenticate. On Windows the only supported SSH authentication agent is Pageant.- Returns:
this
-
agentIdentity
@Stability(Experimental) public SSHProvisionerConnection.Builder agentIdentity(String agentIdentity) Sets the value ofSSHProvisionerConnection.getAgentIdentity()
- Parameters:
agentIdentity
- The preferred identity from the ssh agent for authentication.- Returns:
this
-
bastionCertificate
@Stability(Experimental) public SSHProvisionerConnection.Builder bastionCertificate(String bastionCertificate) Sets the value ofSSHProvisionerConnection.getBastionCertificate()
- Parameters:
bastionCertificate
- 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.- Returns:
this
-
bastionHost
Sets the value ofSSHProvisionerConnection.getBastionHost()
- Parameters:
bastionHost
- Setting this enables the bastion Host connection. The provisioner will connect to bastion_host first, and then connect from there to host.- Returns:
this
-
bastionHostKey
@Stability(Experimental) public SSHProvisionerConnection.Builder bastionHostKey(String bastionHostKey) Sets the value ofSSHProvisionerConnection.getBastionHostKey()
- Parameters:
bastionHostKey
- The public key from the remote host or the signing CA, used to verify the host connection.- Returns:
this
-
bastionPassword
@Stability(Experimental) public SSHProvisionerConnection.Builder bastionPassword(String bastionPassword) Sets the value ofSSHProvisionerConnection.getBastionPassword()
- Parameters:
bastionPassword
- The password to use for the bastion host.- Returns:
this
-
bastionPort
Sets the value ofSSHProvisionerConnection.getBastionPort()
- Parameters:
bastionPort
- The port to use connect to the bastion host.- Returns:
this
-
bastionPrivateKey
@Stability(Experimental) public SSHProvisionerConnection.Builder bastionPrivateKey(String bastionPrivateKey) Sets the value ofSSHProvisionerConnection.getBastionPrivateKey()
- Parameters:
bastionPrivateKey
- 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.- Returns:
this
-
bastionUser
Sets the value ofSSHProvisionerConnection.getBastionUser()
- Parameters:
bastionUser
- The user for the connection to the bastion host.- Returns:
this
-
certificate
Sets the value ofSSHProvisionerConnection.getCertificate()
- Parameters:
certificate
- 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.- Returns:
this
-
hostKey
Sets the value ofSSHProvisionerConnection.getHostKey()
- Parameters:
hostKey
- The public key from the remote host or the signing CA, used to verify the connection.- Returns:
this
-
password
Sets the value ofSSHProvisionerConnection.getPassword()
- Parameters:
password
- The password to use for the connection.- Returns:
this
-
port
Sets the value ofSSHProvisionerConnection.getPort()
- Parameters:
port
- The port to connect to.- Returns:
this
-
privateKey
Sets the value ofSSHProvisionerConnection.getPrivateKey()
- Parameters:
privateKey
- 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.- Returns:
this
-
proxyHost
Sets the value ofSSHProvisionerConnection.getProxyHost()
- Parameters:
proxyHost
- 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.- Returns:
this
-
proxyPort
Sets the value ofSSHProvisionerConnection.getProxyPort()
- Parameters:
proxyPort
- The port to use connect to the proxy host.- Returns:
this
-
proxyScheme
Sets the value ofSSHProvisionerConnection.getProxyScheme()
- Parameters:
proxyScheme
- The ssh connection also supports the following fields to facilitate connections by SSH over HTTP proxy.- Returns:
this
-
proxyUserName
@Stability(Experimental) public SSHProvisionerConnection.Builder proxyUserName(String proxyUserName) Sets the value ofSSHProvisionerConnection.getProxyUserName()
- Parameters:
proxyUserName
- 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.- Returns:
this
-
proxyUserPassword
@Stability(Experimental) public SSHProvisionerConnection.Builder proxyUserPassword(String proxyUserPassword) Sets the value ofSSHProvisionerConnection.getProxyUserPassword()
- Parameters:
proxyUserPassword
- 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.- Returns:
this
-
scriptPath
Sets the value ofSSHProvisionerConnection.getScriptPath()
- Parameters:
scriptPath
- The path used to copy scripts meant for remote execution. Refer toinvalid @link
{@link https://developer.hashicorp.com/terraform/language/resources/provisioners/connection#how-provisioners-execute-remote-scripts
- Returns:
this
-
targetPlatform
@Stability(Experimental) public SSHProvisionerConnection.Builder targetPlatform(String targetPlatform) Sets the value ofSSHProvisionerConnection.getTargetPlatform()
- Parameters:
targetPlatform
- 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"- Returns:
this
-
timeout
Sets the value ofSSHProvisionerConnection.getTimeout()
- Parameters:
timeout
- The timeout to wait for the connection to become available. Should be provided as a string (e.g., "30s" or "5m".)- Returns:
this
-
user
Sets the value ofSSHProvisionerConnection.getUser()
- Parameters:
user
- The user to use for the connection.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<SSHProvisionerConnection>
- Returns:
- a new instance of
SSHProvisionerConnection
- Throws:
NullPointerException
- if any required attribute was not provided
-