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

high-leather-15669

02/09/2022, 12:19 PM
Hello @echoing-match-29901 If I want some custom code to be executed based on whether it is
pulumi up/destroy/preview/etc..
is there a variable which I could use inside my `python`programs? something like
pulumi.cli.arg[1]
or so?
e

echoing-dinner-19531

02/09/2022, 1:18 PM
Your pulumi program won't run during a
destroy
call, but you can tell the difference between preview and update with
runtime.is_dry_run()
Although most cases like this what you actually want is a dynamic provider: https://www.pulumi.com/blog/dynamic-providers/
3 Views