How do I rename a stack if I don't have access to ...
# general
w
How do I rename a stack if I don't have access to the actual stack (it is part of an automation project). Running
pulumi stack rename <new-name> -s <old-name>
doesn't work. Output from this is: error: no Pulumi project found in the current working directory. If you're using the
--stack
flag, make sure to pass the fully qualified name (org/project/stack) Do I have to be in a project directory to rename a stack?
f
I had a similar issue and then I found this inside the "settings" tab of my stack. I guess the same applies to
pulumi stack rename
command. Perhaps there is a more convenient but I don't know it: Recovering Configuration Deleting this stack or this stack's resources requires that you have a
Pulumi.yaml
file in the same directory. If you no longer have access to the Pulumi program's source code, you can recreate the configuration files with the following commands:
Copy code
# Pulumi.yaml
echo "name: project-name" > Pulumi.yaml
echo "runtime: nodejs" >> Pulumi.yaml

# Pulumi.stack-name.yaml
pulumi stack select org-name/project-name/stack-name
pulumi config refresh
👍 1