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

better-rainbow-14549

07/26/2019, 3:02 PM
i'm trying to follow this: https://www.pulumi.com/docs/reference/programming-model/#dynamic-provider-examples but i can't see how i would expose further properties? I want to generate two related numbers at create time, and then be able to access them in future. how is that done please? the other examples here aren't really helping: https://github.com/pulumi/pulumi/blob/master/examples/dynamic-provider/simple/index.ts
t

tall-librarian-49374

07/26/2019, 3:18 PM
b

better-rainbow-14549

07/26/2019, 3:19 PM
oh that's far more complete thanks
still struggling to see how to populate the properties for future runs
how / when is e.g. the property on line 269 populated with the value from the state
t

tall-librarian-49374

07/26/2019, 3:47 PM
b

better-rainbow-14549

07/26/2019, 3:47 PM
i mean on future runs though
t

tall-librarian-49374

07/26/2019, 3:47 PM
They will be saved in state
b

better-rainbow-14549

07/26/2019, 3:47 PM
e.g. if i add another resource later that depends on that property
yes but when is it populated back from state
t

tall-librarian-49374

07/26/2019, 3:48 PM
that should be taken care by pulumi
b

better-rainbow-14549

07/26/2019, 3:53 PM
can i spam a super simple example i'm not getting anywhere i think i must be missing something fundamental
t

tall-librarian-49374

07/26/2019, 3:54 PM
sure, put it on github or gist
so in my state file I can see the token was created properly and all the outputs are popualted
t

tall-librarian-49374

07/26/2019, 3:58 PM
ah, I suspect you need to do one more thing: initialize those props in constructor, see https://github.com/pulumi/examples/blob/master/azure-ts-static-website/staticWebsite.ts#L72
b

better-rainbow-14549

07/26/2019, 4:00 PM
ahhhh thanks a lot
yep working now 👌
t

tall-librarian-49374

07/26/2019, 4:03 PM
I'm actually not sure why this is required. Might be worth filing an issue
w

white-balloon-205

07/26/2019, 4:09 PM
I am actually just about to do some updates to these docs today - and will see about making this point clearer.
b

better-rainbow-14549

07/30/2019, 4:52 PM
I've upgraded pulumi today - from .16 to .21 and then to .26 and then to .27
and on the .16 to .21 my partnerToken from that gist was reset and regenerated, and it was reset to undefined.undefined from .26 to .27
is this a bug in pulumi or is there a flaw in my dynamic resource?
w

white-balloon-205

07/30/2019, 5:01 PM
I'm not sure I follow exactly what you saw happen. Was this resource replaced or updated in any of the deployments? If so, what diffs were shown?
Could you open an issue with any details?
b

better-rainbow-14549

07/30/2019, 5:02 PM
what i saw in the diffs was that the serialized "_provider" changed
and essentially its acted as if i recreated the resource but i didnt
well, from .16 to .21 it did
but from .26 to .27 it's not recreated it and it's just blanked out the outputs
sorry the .16 to .21 was a mistake on my part - it seems we destroyed the entire stack, but the .26 to .27 is still an issue