https://pulumi.com logo
Title
b

big-glass-16858

05/31/2019, 2:29 PM
Hi there, is
register_outputs()
mandatory in a
ComponentResource
to use a variable output in another top level resource ? or can i reference directly the
ComponentResource
class property ?
w

white-balloon-205

05/31/2019, 3:41 PM
You can reference the class properties.
register_outputs()
should be called to indicate when you are done adding children (so the
...
in the CLI stop displaying), but other than that, any properties returned are just used for display in the CLI/diffs, not for anything in the programming model itself.
b

big-glass-16858

05/31/2019, 7:02 PM
@white-balloon-205 Thank you for the explanation.
p

proud-artist-4864

06/03/2019, 8:47 AM
@white-balloon-205, how does another resource refer to the registered output promises so that they properly get included in the DAG? Or should I refer to the actual resources created inside the ComponentResource? eg, ComponentResource creates an AWS VPC and I register an output of the vpc.id as vpc_id. Should I refer to Component.vpc.id or Component.vpc_id?