This message was deleted.
# general
s
This message was deleted.
n
Which cloud provider is it?
b
@chilly-computer-67665 we usually recommend dynamic providers for this, but they aren't currently supported in Go. Your best bet is to use
user_data
in your cloud provider
c
Thanks! I'm using Hetzner Cloud. I'll give
user_data
a go
I'm really struggling to find any documentation for
user_data
, is there anything better than https://www.pulumi.com/docs/intro/concepts/programming-model/#additional-examples?
b
Take a look in this repo https://github.com/pulumi/examples
c
Thanks for the link, though that on its own is almost beyond useless 😂. I found some examples thanks to sourcegraph: https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/pulumi/examples%24+userData+lang:go+&patternType=literal
Managed to get it working with
userData
, 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://
.