-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pulumi stack rename
to allow you to rename a stack
#2402
Comments
Just as an FYI, I do not think we can 100% guarantee the operation is safe. So we want to add a warning by default, such as when trying to delete a stack that still has resources. (And Doing a find/replace across resource URNs will cover the majority of cases. But because you can get the stack's name at runtime via pulumi.getStack, it's possible to have the stack's name bleed into resource properties too. (And applying the same find/replace could lead to false-positives for a generic stack name.) In practice I don't think this is going to be a problem, but I can imagine situations where renaming a stack could lead to trouble. Alternatively, we may want to have the |
Actually the common case is even worse -
This is an interesting idea... |
I understand what you are saying here, but I wanted to point out that a rename operation by itself can be 100% safe, assuming that we just operate on the checkpoint file. Now, it's true that if you the output of Note we already have a version of this problem for any external observable state from update to update. For example, if you happened to use the value of a configuration variable to name a resource, then using
@lukehoban and I were talking about this in person. I am not sure if it is a special kind of operation, but I could imagine value in |
Fixed with #2561. |
wait-wait, so I can create stacks with the same name. how does that work? how would i differentiate between those? |
You cannot create two stacks with the same fully qualified name. You can have two stacks named, e.g. What specific comment here led you to think there was a potential concern here? |
i was just wondering how it works, thats it ;) |
Now that we no longer require stack names to be unique across an organization it's natural to want to rename and existing stack you've created, since we previously recommended to use
<project-name>-<unique-identifier>
as a stack name, e.g (my-great-project-dev
).Today, renaming a stack is not a straightforward process. In addition to backend specific changes, the stack's name is also part of the URN of every resource we've created for a stack, so simply changing the name would cause the engine to believe that it needs to replace every resource.
We should add a
pulumi stack rename
command which should handle both backend specific logic to do the rename (e.g. in the service, updating some metadata about a stack name) and handle the updates needed to the existing checkpoint file such that URNs now have the new stack name.The text was updated successfully, but these errors were encountered: