modern-zebra-45309
10/09/2025, 2:51 PM{ ingoreChanges: ['__provider']} does not have to seem any effect, it still tries to replace the resource, with the only diff between "old" and "new" being some changes in the provider's code: pulumi-nodejs:dynamic:Resource my-project create replacement [diff: ~__provider] .
I do understand that it makes sense to replace on provider changes in general, but I would like to control when that happens. The resource I create here is a container for other resources, and it's also a resource that cannot be deleted (just marked archived). I could not find anything in the docs or the Slack archive. Intuitively, I'd expect there to be some ID (e.g., a UUID) on the provider that I can change to signal that the provider is different now.echoing-dinner-19531
10/09/2025, 3:04 PMdiff method? I think if you return a diff result from that that isn't DIFF_UNKNOWN then it won't hit the default logic to replacemodern-zebra-45309
10/09/2025, 3:15 PMasync diff(id: string, olds: MyProjectInputs, news: MyProjectInputs) {
const changes: string[] = [];
console.log('Olds:', olds);
console.log('News:', news);
if (olds.name !== news.name) {
changes.push('name');
}
return { changes: changes.length > 0, replaces: [] };
}
When I look at the console log, I see that "olds" and "news" contain the "__provider" key that is shown to be what has changed. The "name" has not changed, and would not require a replacement.modern-zebra-45309
10/09/2025, 3:18 PMclass MyProjectProvider implements pulumi.dynamic.ResourceProvider {
private __provider_version = "123";
to signal that despite changes to the code, the provider should not be considered changed. (But I might be on the wrong track here entirely.)modern-zebra-45309
10/09/2025, 3:26 PM// Note that we do not take any special action if the provider has changed. This allows a user to iterate on a
// dynamic provider's implementation. This does require some care on the part of the user: each iteration of a
// dynamic provider's implementation must be able to handle all state produced by prior iterations.
//
// Prior versions of the dynamic provider required that a dynamic resource be replaced any time its provider
// implementation changed. This made iteration painful, especially if the dynamic resource was managing a
// physical resource--in this case, the physical resource would be unnecessarily deleted and recreated each
// time the provider was updated.
This sounds exactly like what I want. Will investigate why I'm not seeing this behavior.modern-zebra-45309
10/09/2025, 3:33 PMechoing-dinner-19531
10/09/2025, 3:35 PMechoing-dinner-19531
10/09/2025, 3:35 PMmodern-zebra-45309
10/09/2025, 3:37 PMmodern-zebra-45309
10/09/2025, 5:00 PMupdate [diff: ~__provider]). I don't really understand what caused this change in behavior. The second one is still trying to replace the resource.modern-zebra-45309
10/09/2025, 5:30 PMechoing-dinner-19531
10/09/2025, 5:45 PMmodern-zebra-45309
10/09/2025, 6:22 PM