https://pulumi.com logo
Title
p

polite-ocean-13631

11/02/2022, 10:13 PM
We can register additional resource outputs with
register_output
as explained here: https://www.pulumi.com/docs/intro/concepts/resources/components/#registering-component-outputs How can we hide outputs? I want to make it so that my custom components only expose a small subset of their outputs to ensure we don't accidentally develop a dependency on something unstable.
l

little-cartoon-10569

11/02/2022, 11:45 PM
Don't make them
public
?
There is no relationship between registered outputs, and code that developers can use. Registered outputs is a Pulumi-internal concept, used for finalizing dependencies and update the graph (in the CLI) and resource widgets (Pulumi service).
To make something private in your ComponentResource class, just declare it as private / not public.
p

polite-ocean-13631

11/03/2022, 12:02 AM
I'm using Python, which does not have private attributes.
There is no relationship between registered outputs, and code that developers can use.
What do you mean? Our stacks can't access a value from a previously deployed stack unless it was exported, and when you export a component it exposes every registered output.
Or does it just attempt to expose every attribute? That seems to be the case.
The docs say we should call
register_output
no matter what at the end of
__init__
. When would it matter whether we do or not?
l

little-cartoon-10569

11/03/2022, 12:20 AM
The component method register_outputs isn't related to stack outputs. It's only about component outputs.
There's a separate list of stack exports that you get to explicitly choose in your main project file.
E.g. this project exports only two values. The resources it creates probably have over 50 registered outputs between them, but only two are exported.
p

polite-ocean-13631

11/03/2022, 12:22 AM
Thanks for the example. I was mixing up those two concepts.
I have a class that produces many
Output
wrapped objects. Should they all be passed into
register_output
? Does it really matter?