https://pulumi.com logo
#general
Title
# general
m

mammoth-honey-6147

10/15/2021, 4:40 PM
Perhaps I'm approaching this the wrong way but in my Pulumi code I use my languages' ssh lib to make ssh calls to VM's provisioned by Pulumi (from another stack, I pass the VM's details to another stack) to run some commands. When I run a
pulumi preview
, it seems to run these commands, how should I prevent this?
b

billowy-army-68599

10/15/2021, 4:49 PM
are you using a dynamic provider? how is it implemented?
m

mammoth-honey-6147

10/15/2021, 4:51 PM
No dynamic provisioner, literally just importing a ssh package, using
apply
to get the string value and calling that package
I assume a dynamic provisioner is what I should be doing?
b

billowy-army-68599

10/15/2021, 4:57 PM
dynamic provider, yep. That way it takes part in the pulumi lifecycle
note: dynamic providers are only supported in python and nodejs
m

mammoth-honey-6147

10/15/2021, 4:59 PM
cries in go
Better go learn Python then 😄
Thanks again @billowy-army-68599 for indulging my silly questions.
b

billowy-army-68599

10/15/2021, 5:01 PM
oh not silly at all! can you talk a little bit more about what you want to do in SSH? I wonder if there's a better way
m

mammoth-honey-6147

10/15/2021, 5:07 PM
Mainly to extract a kubeconfig from a node I'm turning into a k3s cluster. I could just bootstrap the install script in as cloud-init data but the kubeconfig issue presents an issue, as I want to use it to provision workloads.
Come to think of it I could just write a workload that mounts it and fires it off to a S3 bucket/Git repo
b

bitter-island-28909

10/15/2021, 6:05 PM
one note: Dynamic Providers are currently mostly broken in Python: https://github.com/pulumi/pulumi/issues/7453