https://pulumi.com logo
#getting-started
Title
# getting-started
r

rough-oyster-77458

03/30/2022, 6:36 PM
Hi, Why if I set
parent=parent_id
to a resource Pulumi wants to delete this resource? Is that expected behaviour?
b

billowy-army-68599

03/30/2022, 6:37 PM
@rough-oyster-77458 because you're changing the URN. you can use to point to the old resource urn and stop the deletion behaviour:
once the urn has been updated pulumi knows the two resources are related, and reconciles them
r

rough-oyster-77458

03/30/2022, 7:08 PM
thanks a lot. After your advice, I fixed the issue by adding
aliases=['old-urn']
. It would be great to add this to
parent
ResourceOptions documentation page. Because this behaviour looks pretty confusing for a new user.
l

little-cartoon-10569

03/30/2022, 8:09 PM
It is there. 3rd last paragraph:
aliases: Aliases applied to a parent are applied to all child resources, so that changing the type of a parent resource correctly changes the qualified type of a child resource, and changing the name of a parent resource correctly changes the name prefix of child resources.
Wording is reasonably indecipherable though. Could be simplified.
5 Views