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

echoing-breakfast-73834

06/01/2020, 9:23 PM
Do child resources of a
ComponentResource
have to be named uniquely for the entire stack (as in different for all instances of a given
ComponentResource
) or just unique within each
ComponentResource
instance? In other words, if I have a structure like this:
Copy code
| ParentResource
|- ChildResource
Can I instantiate two instances named like this where both ChildResources have a locally but not globally unique name:
Copy code
| A-ParentResource
|- B-ChildResource

| B-ParentResource
|- B-ChildResource
Or do I have to do something like this where each ChildResource has a locally and globally unique name:
Copy code
| A-ParentResource
|- B-ChildResource

| B-ParentResource
|- C-ChildResource
a

able-beard-29160

06/01/2020, 9:33 PM
Resources constructed as children of a component should make sure that their names will be unique across multiple instances of the component. In general, the name of the component instance itself (the name parameter passed in to the component constructor) shoud be used as part of the name of the child resources.
https://www.pulumi.com/docs/intro/concepts/programming-model/#resource-arguments
(scroll up a bit)