Open jaysonsantos opened 3 years ago
Taking a closer look at terraform's code, I am coming to the conclusion that there i no way for the tunnel to live throughout the whole terraform flow, as the provider is killed right after the data source is read. What could work is by forking the current process to make it live even after the plugin is dead, but then it would have to have a mechanism to finish after some idle time. Probably calling ssh itself and sending it to the background could also be a viable option.
Is it somehow possible to store the PID of the forked process and kill it after terraform exits? A timeout is not an ideal solution since it is impossible to know how long the ssh connection has to remain open for terraform in advance.
This should probably fix #3 and #5