sparse-intern-71089
08/21/2020, 9:24 AMnarrow-jackal-57645
08/21/2020, 11:30 AMbillowy-army-68599
user_data
in your cloud providerchilly-computer-67665
08/22/2020, 9:44 AMuser_data
a gochilly-computer-67665
08/22/2020, 9:51 AMuser_data
, is there anything better than https://www.pulumi.com/docs/intro/concepts/programming-model/#additional-examples?billowy-army-68599
chilly-computer-67665
08/22/2020, 3:41 PMchilly-computer-67665
08/22/2020, 8:43 PMuserData
, thanks @billowy-army-68599. In the end I was able to make a single pulumi workflow that:
1. Adds an SSH key to my Hetzner account
2. Creates a Hetzner VM with said SSH key (installing docker on the host via userData
)
3. Creates a Docker provider for controlling docker on the new VM via <ssh://root>@<ip>
4. Spins up my desired Docker container on the VM.
I was pretty happy with having it all working, but I had to introduce a little hack between steps 2 and 3 to dynamically update the known_hosts
on my machine based on the new VMs host key. I've pushed it all to https://github.com/johanbrandhorst/pulumi. Would appreciate any feedback on the approach. I would be particularly interested in hearing whether it'd be possible to create a docker provider using the SSH connection I'm establishing inside the application, rather than relying on ssh://
.