Is it possible to write a provider that forces an ...
# general
r
Is it possible to write a provider that forces an update when a resource that it dependsOn is updated? I could serialize its inputs as JSON and compare the string, but I wonder if there is a more elegant way.
a
I actually chose a similar strategy! I wrote the provider, had it accept a list of Pulumi resource ids (dependencies I wanted to bind my custom resource to). And then I marked up logic in the ‘diff’ method of the provider to signal a replacement if any of those strings changed. I didn’t even have to set an explicit “dependsOn” because I think it’s implicit if you feed any resource/resource’s lifted value to the custom resource implemented on top of your provider. But if you find a better way, also let me know! 😅 I am genuinely curious how others tie a Custom Resource’s lifetime to other standard stock resources.