docs icon indicating copy to clipboard operation
docs copied to clipboard

Detect when Dynamic Provider code has changed (may be with a version number)

Open boillodmanuel opened this issue 4 years ago • 0 comments

Affected feature

I created a dynamic provider to manage Azure (see source code in this comment)

I updated several times the dynamic provider source code, especially to make the pulumi refresh working as expected. Each time I updated the code (the read method here), the code was not taken in account in the next pulumi refresh. I tried to do a pulumi up but this hasn't changed anything. @mikhailshilkov suggests me to delete the resource, and this was the only way for me to use the latest code (thanks Mikhail).

Later I found a workaround. I forced the update of the provider by returning {changes: true} in diff function.

I read the doc several times, but it was very painful to make it working.

Following tasks would help a lot:

  • explain in documentation that refresh rely on read method (currently read seems to be used only by import)
  • explain in documentation that refresh rely on the code serialized in the state (and how update it)
  • be able to update the provider (in the state) when code has changed (either manually or automatically). Adding a version method may do the job?

boillodmanuel avatar Mar 09 '21 23:03 boillodmanuel