This message was deleted.
# python
s
This message was deleted.
l
You can check between
preview
and
up
using the
is_dry_run
function from the core Pulumi SDK: https://www.pulumi.com/docs/reference/pkg/python/pulumi/#pulumi.runtime.is_dry_run When
destroy
runs, the language host is not involved as Pulumi destroys the resources based on what is in the state, not what is in your Pulumi program.
👀 1
✅ 1
s
🙌
is there an equivalent for
destroy
?
l
No, because during
destroy
, your program isn't loaded. As mentioned above, Pulumi deletes the resources it can find in the state of your stack. Can you explain why you would need it during
destroy
?
s
Right, good point. I am reaching out to an external database doing crud operations
Perhaps i need to create a custom resource, or custom provider
l
@strong-helmet-83704 is this what you are after? https://github.com/pulumi/pulumi/issues/9397
s
kinda… I did consider wrapping the program to perform cleanup tasks outside of Pulumi… but this seems less neat
The other thing i could do is refactor the program with automation api and have a custom interface for invoking my program. but this is a major overhaul and automation api does not have all the features of the regular cli
i think for now the best bet might be https://www.pulumi.com/docs/intro/concepts/resources/dynamic-providers/ @kind-jelly-61624