This message was deleted.
# general
s
This message was deleted.
e
I think that it depends on the ability to determine in code if pulumi is doing an
update
or a
destroy
c
I think you can use a dynamic resource provider for this. https://pulumi.io/reference/programming-model/#dynamicproviders
Short of writing my own Pulumi provider for the purpose, the gitlab REST API works great for this, so I thought perhaps there’s a way in pulumi to:
- during
update
check if a scheduled pipeline already exists via the gitlab API, and if it doesn’t then create one
- during
destroy
check if a scheduled pipeline already exists via the gitlab API, and if it does then delete it
Do note, though, with a dynamic provider, it itself is bound by the rules of a resource lifecycle like any other resource. That means, its destroy/create/update functions are only called if the
diff
function indicates to the engine that there are changes and a replacement or a delete/create has to occur. You could pass as inputs another resource’s properties, which could help your
diff
function determine the correct action based on whether or not something changed in the dependent properties, i.e. trigger a delete/create when appropriate.