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

little-fish-42857

07/19/2023, 4:16 PM
Hello, I have a question related to dynamic resource providers. I understand that the standard way to supply inputs to the resource is through the
Props
. Now let's assume that my dynamic provider requires a credential as part of it's inputs and I supplied it through my pulumi program config. Since it's part of the input props, the stack will snapshot those values and reuse them during refresh/delete operations. Now for some reason I had to rotate that credential. Now when I issue a refresh or delete on my stack it will fail on my dynamic resource because the credential it has in its props are no longer valid. Is there any way to make sure that it reads certain values always from the program config object?
s

stocky-restaurant-98004

07/19/2023, 4:18 PM
I don't know the answer for certain, but this is what I would try: https://www.pulumi.com/docs/concepts/options/ignorechanges/
l

little-fish-42857

07/19/2023, 4:21 PM
I'm not sure how this can apply because what im looking for is a way to define some values I send to the dynamic resource not as an input but more as a "provider config". In regular resources the provider information is supplied separately to resource params which solves this problem as the provider initialization happens at runtime and will always use the credentials from the config/env. So resource operations will always have the latest provider information...
Looking for a better way to achieve this essentially -> https://github.com/pulumi/examples/blob/master/classic-azure-ts-dynamicresource/cdnCustomDomain.ts#L52-L81 but as you can see it's kind of guessing what the credentials will be and trying a bunch of stuff. May be I could use
pulumi.Config
to retrieve values in the provider itself if i can't pass them from my main program code
e

echoing-dinner-19531

07/19/2023, 9:45 PM
Config sadly doesn't work in dynamic providers. But even if it did the problem of refreshing short lived credentials is more wide spread than just dynamic providers, see https://github.com/pulumi/pulumi/issues/9107.