r

    rough-oyster-77458

    5 months ago
    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

    5 months ago
    @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

    5 months ago
    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

    5 months ago
    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.