https://pulumi.com logo
s

strong-match-67698

08/31/2023, 9:57 AM
Can anyone explain what a '*remote component resource'* is? I can't find anything about it in the documentation, while it exists in the code:
l

little-cartoon-10569

08/31/2023, 11:01 PM
That's a picture of text. Can you include a link to the GitHub, and/or include more text (not a picture)? Can't tell from just this, as there's no context.
s

strong-match-67698

09/01/2023, 8:29 AM
well, it's a ComponentResource constructor, I guess there is just one for .net and you'll know better where to find it
anyway, what I'm trying to achieve is to reference component resource from one stack to another, any hints how to do it?
l

little-cartoon-10569

09/03/2023, 7:46 PM
There's two ways to interpret that. • If you want the class to be available, use the normal language feature that enables importing a class. • To export an instance, then normal Pulumi stack references are the way to go. However, exporting an object isn't generally a good idea, since you'd have to write your own marshalling logic in your component resource class. Generally it's better to export primitives. And since other resource constructors only ever take those primitives as parameters, that works out ok.
I looked up the docs for remote and there's no helpful explanation for it. Maybe you could ask about that in #dotnet?
s

strong-match-67698

09/12/2023, 10:01 AM
well, that's what I thought
However, exporting an object isn't generally a good idea, since you'd have to write your own marshalling logic in your component resource class.
any example in pulumi docs how this can be done?
l

little-cartoon-10569

09/13/2023, 10:43 PM
No, this would be dependent on your language and the libraries available to you. You could use JSON.parse / JSON.stringify, you could use a YAML parser library, or you could just a pile of primitive values and pass them all in to a constructor in your resource class.