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

big-glass-16858

05/22/2019, 12:24 PM
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

broad-dog-22463

05/22/2019, 12:53 PM
@stocky-spoon-28903 ☝️ it's about your example repo
s

stocky-spoon-28903

05/22/2019, 12:56 PM
@big-glass-16858 - I’ll come back to this shortly! I just need to finish up fixing another issue first
b

big-glass-16858

05/22/2019, 12:57 PM
sure, no worries, take your time 😉
s

stocky-spoon-28903

05/22/2019, 2:24 PM
Sorry, back now. I probably should be using
registerOutputs
here
b

big-glass-16858

05/22/2019, 2:51 PM
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 ?