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

numerous-toddler-24038

06/13/2023, 11:26 PM
Using the C# API, if I create a ComponentResource, how do I block Outputs until all child resources have been created? I know I can do DependsOn but I'd rather just have those semantics automatically unless I explicitly opt out of them
fwiw this is what I though
this.RegisterOutputs()
was doing under the hood, but that doesn't appear to be the case
w

white-balloon-205

06/14/2023, 12:57 AM
You can expose an output that uses All and Apply to wait on multiple inputs, but resolve to the value of just one. This can give you back a single output that waits for everything you want to make sure is created before using it. RegisterOutputs does work for dependsOn, as a way to indicate what other resourcss must be transitively depended on, but individual outputs you store on the component don’t by default know they should be coupled to the component itself. I do think we may want to add a helper which lets you mix the component (and its inferred transitive dependencies) into an output as part of assigning it to an output on the component.
n

numerous-toddler-24038

06/14/2023, 4:08 AM
You can expose an output that uses All and Apply to wait on multiple inputs, but resolve to the value of just one. This can give you back a single output that waits for everything you want to make sure is created before using it.
Yeah that's what I did, which isn't too counter intuitive but the semantics are definitely suboptimal. I was looking through the source a bit and it seemed like it might be possible to gate the completion sources somehow