Is there any reason we can't just use the resource struct as the source of truth, and have ways to get its properties as a Map for purposes of the other calls? For example, a PropertyMap() function or method on ResourceState that uses reflection to look for pulumi tags would seem to do the trick. For the example linked to above, it's not too bad, because there are only two properties -- however, I have a Go component that has 20, and I'm finding that it's rather tedious and error prone.
It seems there are three places a resource's properties need to be specified:
pulumi
tags on its fieldsRegisterResourceOutputs
, after the resource is createdState
returned from the call to construct the resourceIs there any reason we can't just use the resource struct as the source of truth, and have ways to get its properties as a
Map
for purposes of the other calls? For example, aPropertyMap()
function or method onResourceState
that uses reflection to look forpulumi
tags would seem to do the trick. For the example linked to above, it's not too bad, because there are only two properties -- however, I have a Go component that has 20, and I'm finding that it's rather tedious and error prone.