https://pulumi.com logo
Title
m

melodic-policeman-1516

12/05/2022, 8:31 PM
Hi! Is there a way to rename a project?
b

billowy-army-68599

12/05/2022, 9:02 PM
yes, just modify the project name in your `Pulumi.yaml`\
m

miniature-musician-31262

12/06/2022, 10:00 PM
This might’ve changed, but won’t that fail to find the previous name and create a whole new project?
m

melodic-policeman-1516

12/06/2022, 10:02 PM
renaming the project in
pulumi.yaml
does indeed create new resources.
m

miniature-musician-31262

12/06/2022, 10:02 PM
When I try that locally, I get prompted to create a new stack, yeah
We do have
pulumi stack rename
, though 🤔 I haven’t used it yet, but it looks like you can pass it a fully-qualified stack name, so like
pulumi stack rename some-org/new-project-name/stack-name
Yeah, that does seem to work. Let me see if I can dig up some documentation for it.
You’d need to rename your stacks one at a time, if you have multiple stacks in a given project, and then change the project name in
Pulumi.yaml
when you’re done renaming all of them, but otherwise, resources all seem to come across into the new stack. (I’m using the Service backend, but I’d assume it’s the same with other backends as well.)
Ah, notably:
You can also rename the stack’s project by passing a fully-qualified stack name as well.
m

melodic-policeman-1516

12/06/2022, 10:22 PM
sweet this worked in my case as well! Thank you @miniature-musician-31262
m

miniature-musician-31262

12/06/2022, 10:23 PM
Excellent!
One thing is that you do need to change the name of the project in
Pulumi.yaml
after all of the stacks in that project have been renamed. Otherwise, your next Pulumi up will try to find a project by the old name and not find it (as it’s now got the new name).