This message was deleted.
# general
s
This message was deleted.
g
Do you mean on the resource that was created? e.g. ssh'ing to a virtual machine and running a script Or do you mean running locally where the Pulumi client is running?
i
locally
I can of course run
pulumi up
in a script of my own
but wondering if there's a local-exec resource
g
There is not a local-exec resource built in.
You can run code (e.g. a shell command) from within the apply function off a resource property and it will run when that property is available (once created and on each subsequent update).
i
got it. thanks
g
Also, depending on what you're wanting to do, our Automation API might be more appropriate. https://www.pulumi.com/blog/automation-api/
i
interesting. I'll take a look. do you have an example of running a shell command post-apply handy?
other examples that would be super useful: dealing with the output of Helm-created resources
b
@icy-london-56932 which sdk are you using?
i
node.js
b
you could create a DynamicProvider that does thatever you need on the local filesystem, then you can do the
dependsOn
because it becomes a part of the pulumi lifecycle: https://www.pulumi.com/blog/dynamic-providers/#dynamic-resource-provider
i
👍
p
@icy-london-56932 I had the exact same requirement and I did this: https://gist.github.com/imod/9a664c38d40256726028ab5a3b7f108f - maybe it is of any help. If you came up with a better solution, please share. Please note: My proposed Resource does work, but it is executed everytime, the
FIXME
the place where the problem is, but I could not find a solution for it. Maybe @billowy-army-68599 or @gentle-diamond-70147 has an idea?
🙏 1