Hi there, I would like to have more information o...
# general
b
Hi there, I would like to have more information on
registerOutputs()
, for example gh:jen20/pulumi-aws-vpc does not look to have one but the docs says it is recommended, should all the exported values by registered in
registerOutputs()
? . Also, is it okay to access directly members of an ComponentRessource Instance ? let's say I have a something like this :
Copy code
class MyRes(ComponentResource):

    def __init__(self,  str_example: pulumi.Input[str], opts=None) -> None:
        props = {
            "str_example": str_example,
        }

        super(MyRes, self).__init__(
            'custom:my_res',
            name,
            props,
            opts)

        self.str_example = str_example

        self.register_outputs({})



my_res = MyRes('example')

# use my_res.str_example
It seems to work just fine (getting type pulumi.Output[T]) , is that incorrect ?
b
@stocky-spoon-28903 ☝️ it's about your example repo
s
@big-glass-16858 - I’ll come back to this shortly! I just need to finish up fixing another issue first
b
sure, no worries, take your time 😉
s
Sorry, back now. I probably should be using
registerOutputs
here
b
thank @stocky-spoon-28903, can you tell me what is the purpose of using
registerOutputs()
? Also Is it okay to use instance members from a ComponentResource to use in another component ?