This message was deleted.
# general
s
This message was deleted.
b
I wonder if this is possible? I can’t find anything about it. @tall-librarian-49374 do you know if dynamic provider / resource support refresh?
t
I think yes, via
read
. Are you asking because it doesn’t work?
b
yes. I haven’t implemented the
read
method, I just add a
console.log
, but it was never called, I will try to implement it
Here is my implementation
Copy code
async read(id: pulumi.ID, props?: any): Promise<pulumi.dynamic.ReadResult> {            console.log(`pulumi.dynamic.ResourceProvider: call --read-- on ${id}`)
      <http://pulumi.log.info|pulumi.log.info>(`pulumi.dynamic.ResourceProvider: call --read-- on ${id}`)
return {id: ''}
 }
Then I do a
pulumi up
to serialize this to the state. Then I do a
pulumi refresh
, but the resource is not refreshed and I can’t see any logs
The pulumi refresh output are
Copy code
~  pulumi-nodejs:dynamic:Resource mgsub-sub-it-foundations-test-a-sandbox refreshing 
    pulumi-nodejs:dynamic:Resource mgsub-sub-it-foundations-test-a-sandbox
t
That’s odd. To be sure - did you create your resource after you added the read implementation?
b
no I haven’t recreated it
I will try
it works 👍
but it’s still obscur for me
and this is not documented
do you have more details?
t
Your code is saved in resource state. You need to update the resource to update the code, including read and delete
b
I’ve done this before, … unless I miss something. That’s said, thank for your help 🙂
I finally succeed to make refresh working. I updated the example in https://github.com/pulumi/pulumi-azure-native/issues/553 I opened an issue to explain my pain 🙂 https://github.com/pulumi/pulumi/issues/6490
👍 2