Add support for remote port fowarding for SSH connections used by Provisioners #13432
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
During the bootstrapping phase the instances you are provisioning might not yet have
direct network connectivity to resources required for provisioning. If the node used
for provisioning has the required access, then by using SSH remote port forwarding
we can give the node being provisioned network access to the required resources.
This PR adds that capability for provisioners when using an SSH connection.
A new parameter is added to connection type for SSH connections only. The
parameter is used to specify a list of ports forward from host being
provisioned to the local side of the SSH connection (the side running Terraform).
The remote port forwarding is established when the SSH connection is made to
the host being provisioned and it torn down when the SSH connection terminates.
Failure to establish the remote port forwarding does not abort the provisioner,
but does generate a log warning message.