sparse-intern-71089
07/26/2021, 8:12 PMbored-oyster-3147
07/26/2021, 8:18 PMdependsOn is not inherited by parent.
If everything in your component resource was given, dependsOn: this than I think you'd get the behavior you want.curved-ghost-20494
07/26/2021, 8:40 PMcurved-ghost-20494
07/26/2021, 9:10 PMcurved-ghost-20494
07/26/2021, 9:10 PMbored-oyster-3147
07/26/2021, 9:36 PMdependsOn: this is causing a weird chicken-before-egg issue.
Alternatively your ComponentResource could take in a dependents array and then you could pass that array to all it's children so they wouldn't technically depend on the component resource. Whatever ends up working, just need that dependency to be passed downcurved-ghost-20494
07/27/2021, 2:46 AMcomponentResource , async initialize() here https://github.com/pulumi/pulumi/pull/3676, but after converting my certificate creating component to use initialize, the dependsOn on my other componentResource s still don’t work.
There must be a way to tell one “external” (written by me) ComponentResource, to wait for another one to finish constructing it’s children… surely?curved-ghost-20494
07/27/2021, 3:45 AMbored-oyster-3147
07/27/2021, 1:00 PMThere must be a way to tell one “external” (written by me) ComponentResource, to wait for another one to finish constructing it’s children… surely?I would imagine this would only work if both
ComponentResources pass those dependencies down to their children.bored-oyster-3147
07/27/2021, 1:07 PMPulumi.Stack resource or to a Provider , if one is given. You use parent: this inside `ComponentResource`s so that your resources are logically grouped, but again this graph has no affect on resource provisioning.
The second graph is the actual dependency graph. This is generally inferred by the `Output<T>`s that get passed around as those carry dependency information. You can also set explicit dependencies with the dependsOn property, but those are always in addition to any inferred dependencies - you cannot override existing dependencies.
The difference is necessary because the parent/child graph is 1:many while the dependency graph is many:1, because a resource must be able to depend on (and wait for) more than 1 resource, but a many:1 relationship is not conducive to logical grouping. This is why there is a separation.
So this is why a ComponentResource 's children don't depend on their parent ComponentResource. There is nothing that the ComponentResource is provisioning that the children need to wait for, unless you explicitly say otherwise.
If you have ComponentResource A and you have ComponentResource B and you want the children of B to wait for the children of A to finish provisioning, than you will somehow need to get those child resources into the dependsOn property of the children of B . Or at the very least you could use only `A`'s bottom dependent, the last provisioned resource would suffice to cause all of `B`'s children to wait for A.curved-ghost-20494
07/27/2021, 1:22 PMbored-oyster-3147
07/27/2021, 1:25 PM