How can I rename a project which has its state at ...
# general
h
How can I rename a project which has its state at app.pulumi.com? I've destroyed stack resources, but when I change the name in Pulumi.yaml,
pulumi preview
doesn't list stacks anymore. If I revert name change, select stack lists correctly. How can I migrate an existing stack to use the new project name?
1
Tried to follow https://github.com/pulumi/pulumi/issues/950, but I can't find any relevant stacks in
~/.pulumi
. This is because I'm hosting state at app.pulumi.com?
l
If all the stack resources are gone, then do you need the stacks? You can just
pulumi stack init ...
to create them in the new project name. You will also need to
pulumi stack rm
in the old project.
But if you want to rename a project (which works even if you haven't deleted the resources) then you can use
pulumi stack rename
.
There's a little comment in the help output:
You can also rename the stack's project by passing a fully-qualified stack name as well. For example:
'robot-co/new-project-name/production'. However in order to update the stack again, you would also need
to update the name field of Pulumi.yaml, so the project names match.
👍 1
h
Thanks a lot @little-cartoon-10569!
👍 1