This message was deleted.
# general
s
This message was deleted.
g
I'm not entirely sure, you can create Random resources to test it with a local stack
I think it will be recreated since the resource urn will change.
l
You can use aliases to avoid this. Specifically, the
parent
property.
👍 1
So if you're changing the parent of a ComponentResource from
this
to
this.newParent
, you'd have something like
Copy code
new MyComponentResource(name, {}, {
  parent: this.newParent,
  aliases: [{
    parent: this
  }]
});
👍 1
And for the special case where you're moving something with no parent to a parent, use
pulumi.rootStackResource
as the parent alias.
f
👍
I also did a quick test and, if the parent name is not explicitly included in the child’s name, then changing parent has no effect, as long as the new parent component is of the same type as the old one (because that is part of the child’s URN).
g
That is good to know