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

faint-motherboard-95438

12/20/2018, 8:24 PM
I don’t really get what the
registerOutputs()
method is for ? In the example here https://pulumi.io/reference/component-tutorial.html a component property
this.bucketName
is added. In fact we can access the
S3Folder.bucketName
without using
registerOutputs()
so I don’t see the point here ?
w

white-balloon-205

12/20/2018, 9:13 PM
The outputs that are registered on a component are stored in the checkpoint file and displayed in diffs in the CLI and in app.pulumi.com. It is true that currently this is separate from the set of properties that are available via the programming model itself. To first approximation you don't have to provide outputs, but it often makes sense to include them just for presentation in these places. We will likely add more ways these outputs will get presented/used over time. We are also thinking about how we might closer unify the outputs and the properties on the component itself. On normal resources (CustomResource) these two ideas are more closely aligned, and we'd like to bring them closer together for components too ideally.
f

faint-motherboard-95438

12/20/2018, 9:16 PM
Ok got it, thanks. So using it right now is not mandatory and does not have any influence on the way I build and sequence my components.
w

white-balloon-205

12/21/2018, 5:05 PM
That's right. Note that explicitly calling
registerOutputs
when the component is done registering it's children is generally a good idea even if there are no outputs (or you have not decided yet what outputs to publish). That's because the CLI dislay will show animating
...
until the resource call
registerOutputs
or execution finishes. So you'll get a better idea of status in the CLI if your component reports when it is done adding children.
f

faint-motherboard-95438

12/22/2018, 12:41 AM
I’ll try that, thanks. btw I was previously thinking this method was equivalent to the exports from the main file and complementary, but these component outputs are not accessible with
pulumi stack output
or any other way, right ?
w

white-balloon-205

12/22/2018, 1:13 AM
That’s right. FWIW - The stack outputs are actually just the outputs of an implicitly created
Stack
component which all resources without a parent are implicitly patented to. Any exports from the entry point module are turned into outputs on that
Stack
resource.