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

boundless-angle-56560

04/14/2021, 1:23 PM
Hi Everyone, I am scratching my head over one thing. I am implementing my own dynamic provider and this provider accepts a file as an input parameter. I want this provider to update itself if the file's content changes. Shall I use pulumi.FileAsset for that? I mean, shall my resource accept FileAsset as an input paramater? If so, I am not sure how to work with the FileAsset in my dynamic provider impementation as it seems that the object doesn't expose anything (like for example getting the contents of the file).
b

billowy-army-68599

04/14/2021, 3:47 PM
I think you’d be better going back to language primitive here, perhaps md5 the file and run the provider if the md5 changes?
b

boundless-angle-56560

04/14/2021, 9:24 PM
chmmm, it seems it kinda did something. When I passed the FileAsset, it actually computed a hash for me and stored it to the state file and on first run the whole execution passed. On second run however it fails with error: Exception calling application: Invalid asset encountered when unmarshalling resource property
I think it has a problem to unmarshal the values from the state file and fit them back to the FileAsset object when creating "olds and news" for the diff method of my dynamic provider
4 Views