https://pulumi.com logo
#typescript
Title
# typescript
l

lively-crowd-44886

09/07/2021, 11:38 PM
Hey all! Anyone know if there’s a way to refresh the provider state for typescript custom providers?
l

little-cartoon-10569

09/07/2021, 11:46 PM
By provider state, do you mean the cloud resources, or the configuration of the provider object? What isn't working the way you'd like it to?
l

lively-crowd-44886

09/07/2021, 11:48 PM
More specifically dynamic resource providers. Currently looking into an issue where the v1 of the dynamic resource provider had a bug in the diff logic. There’s a fix in v2 but not too sure how to bring this into the state
I guess I could manually replace the transpiled javascript in the state itself - but that feels a bit icky 👀
l

little-cartoon-10569

09/08/2021, 12:34 AM
And the dynamic provider is in a different codebase? Once the right code is being called by Pulumi, that's all you should need. So if it's in a different codebase / package, you'll need to update your packages.json. If it's in the same codebase, it should "just work".
l

lively-crowd-44886

09/08/2021, 12:40 AM
Yup - it’s in the same code base. I don’t think refresh/preview/diff uses the “current” dynamic provider. Instead, it uses the dynamic provider at the point of the last
up
l

little-cartoon-10569

09/08/2021, 12:47 AM
Oh. I haven't encountered that problem. Since the logic isn't in the state file, it seems odd. I think you'll need help from a staff member for that one, it might be pretty involved 😞
Maybe chuck in a few
pulumi.log()
statements into the diff code and verify that they're not being used?
Then raise a GitHub issue in pulumi/pulumi.
l

lively-crowd-44886

09/08/2021, 12:57 AM
Good idea! Yeah, i think it might be typescript specific since i can see the transpiled javascript in the
__provider
property in the state. Anyways, I’ll do some more digging! Thanks for your help!
l

little-cartoon-10569

09/08/2021, 12:57 AM
Ah, then you're a step or two ahead of me already! Good luck!