jaysonsantos / terraform-provider-jumphost

Terraform provider for Hashicups demo app
7 stars 6 forks source link

fix: Try and wait for connetions to be available before sending out the data resource #7

Open jaysonsantos opened 2 years ago

jaysonsantos commented 2 years ago

This should probably fix #3 and #5

jaysonsantos commented 2 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.

PKizzle commented 2 years ago

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.