https://pulumi.com logo
Title
l

limited-rain-96205

07/20/2021, 12:33 AM
If one were to put a new root ComponentResource (which is not describing anything in the cloud -- it's basically a stub) as a new parent resource of everything currently at the topmost level, what would be the easiest & fastest way to apply the change, without having to re-create any existing resources?
b

better-shampoo-48884

07/20/2021, 8:46 AM
set parent of the existing resources that you move into the component resource, then set an
aliases: [{parent: pulumi.rootStackResource}]
.. so that your options would look like this:
},{
            parent: this,
            aliases: [{parent: pulumi.rootStackResource}]
        })
Run the program for each of your existing stacks to update the relationships, once all are updated, you can remove the alias again
l

limited-rain-96205

07/22/2021, 2:13 AM
@better-shampoo-48884 That works perfectly, thanks!