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

wet-noon-14291

09/13/2022, 10:37 PM
What is the benefit of setting the parent property on a resource? The resource graph is more visually pleasing, but is there any other part I'm missing?
l

little-cartoon-10569

09/13/2022, 11:12 PM
Opts are inherited from parents. This is mostly relevant to providers.
👍 1
s

stocky-restaurant-98004

09/14/2022, 1:49 AM
It's mostly relevant in Components. I think @little-cartoon-10569 was specifically referring to the fact that setting a parent will ensure that the child has the same provider as the parent. I wouldn't bother with setting parents unless you're using Components.
l

little-cartoon-10569

09/14/2022, 2:02 AM
Yes, or if you're using objects that are equivalent to ComponentResources. We have a weird logging decorator object that creates a few resources as children of a selection of passed-in resources, so we use
parent
to show the relationship there.
2 Views