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

incalculable-angle-91273

04/12/2019, 6:00 PM
Is there anything like a
local-exec
in pulumi? I want to run a script after a resource gets updated. Specifically for kubernetes I want to refresh pods in an application namespaces after I update my istio helm chart.
c

creamy-potato-29402

04/12/2019, 6:04 PM
not really, you can
.apply
and run a script in there, but it will get executed every
pulumi up
.
closest thing you can do is to create a custom dynamic provider, which is not super easy
b

big-piano-35669

04/12/2019, 6:34 PM
Although not trivial, it's not very difficult either. The docs here are lacking, but we have a simple example at https://github.com/pulumi/pulumi/tree/master/tests/integration/explicit_provider, and docs are available at https://pulumi.io/reference/pkg/nodejs/@pulumi/pulumi/dynamic/.
That said:
Specifically for kubernetes I want to refresh pods in an application namespaces after I update my istio helm chart.
@creamy-potato-29402 @gorgeous-egg-16927 Can you think of a good way of doing this with dynamic providers?
c

creamy-potato-29402

04/12/2019, 6:36 PM
I did not realize that we had docs at all
I am not sure, we thought about having an
Invoke
that lets you do an apply, but that’s not quite the same.
I’m not quite sure how to get the semantics we’d want…
it’s almost like you’d want a kind of “patch” resource.
i

incalculable-angle-91273

04/12/2019, 6:38 PM
yeah a patch is exactly right. I’d basically want the effect of running a script like this against a set of namespaces: https://gist.githubusercontent.com/jmound/ff6fa539385d1a057c82fa9fa739492e/raw/caed819555ecbaa8841c4dce07a367be6f639cc8/refresh.sh