Can you nest a `pulumi.ComponentResource` within a...
# general
f
Can you nest a
pulumi.ComponentResource
within another
pulumi.ComponentResource
? If so, should all ComponentResouces take a
pulumi.ComponentResourceOptions
map?
Further, which resource should pass in
{parent: this}
?
w
Yes - a Component can have a child which is a Component. The resource options are generally inherited from the parent if not overridden in a child, and this inheritance works through both components and custom resources. At each layer, a component should pass
{parent: this}
on any resources it creates to ensure they are parented to it. Those chid resources could be components or custom resources.
f
Got it. Thanks.