https://pulumi.com logo
Title
t

tall-beard-99429

06/11/2021, 1:19 PM
I'm trying to move my stack from 1 project to another to simply the setup, but when I try to do a previiew now iit wants to delete and create all of the resources, how do i fix this?
The name of the project and the stack has changed, it was previously
aws-managed
and
shared
for the stack, but now its
bootstrap
and
main
b

billowy-army-68599

06/11/2021, 1:58 PM
You’ll need to use aliases
I’m on phone at the moment but googling Pulumi aliases should help
b

broad-helmet-79436

06/12/2021, 12:09 PM
Yep all the resource URNs contain the project and stack name, so they are all different now. I believe you can get the current URNs with
pulumi stack --show-urns
and then manually add
aliases: [<the old URN>]
to every resource. it’s a slow & painstaking process if you have a lot of resources and/or abstractions like component resources, but you should be able to get there 🙂
a friendly tip though: do this BEFORE you try to change any of the actual resources, or you’ll probably get burned like I did here https://pulumi-community.slack.com/archives/C84L4E3N1/p1620756393016100
(I spent four hours fixing the mess I made, including reverting all changes to my (fortunately backed-up) stack file twice 😅)
t

tall-beard-99429

06/12/2021, 12:44 PM
I went through and did a find replace on the stack for the URN to match what it would be if i recreated it, that seems to have worked. Any reason for that being bad?