My current thought on this is literally a search-and-replace in the state file for oldprojectname -> newprojectname (and then afterwards rename the stack with pulumi).
l
little-cartoon-10569
03/17/2021, 8:30 PM
I guess just editing Pulumi.yaml wouldn't be particularly "clean", as all the resource URNs would still use the old stack name. You could export from the existing stack, import into a new empty stack in a new project, and then
pulumi stack rm
the old stack?
b
better-shampoo-48884
03/18/2021, 7:28 AM
I'll try it out! I must say I don't really intuit the concept of projects (as far as I've understood it - it's the stacks proximity to a Pulumi.yaml file) so it does feel a bit weird. Definitely better than manually going through all the statefiles and updating all the resources with new names with search/replace 😉