Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for remote port fowarding for SSH connections used by Provisioners #13432

Conversation

peteromoon
Copy link

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.

…visioners.

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.
@apparentlymart
Copy link
Contributor

Thanks for working on this, @peteromoon!

We have this older issue #8367 where we discussed a more general solution to this problem that would work for other resource operations (e.g. retrieving data from a Consul server in the remote network), but your approach here has the advantage of relative simplicity by focusing on a specific situation.

I'm feeling a little ambivalent about merging this and then later having the more generalized solution which could then prove confusing. I'd like to mull this over for a little while, rather than rushing in to merging this.

@teamterraform
Copy link
Contributor

Hi folks! Now that Terraform 0.12 is released, we are undertaking a general GitHub issue/PR cleanup.

This PR touches code that has changed quite a bit since it was originally opened, and in this case it . I am going to close this outdated PR, but please do not hesitate to open a new PR or issue in the future, and thank you!

@ghost
Copy link

ghost commented Sep 5, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants