I there a way to delete every entry in a stacks `s...
# general
m
I there a way to delete every entry in a stacks
state
? I'd rather not delete an entire stack as I have variables and secrets I wish to retain and not re-encrypt. Otherwise I have to go through every URN to do so.
r
Are you happy for the resources to be deleted? If so,
pulumi destroy
should do this for you
m
Happy with that but these resources were deleted outside of Pulumi and therefore cause issues when trying to remove
r
Oh! Does
pulumi refresh
sort you out then? That should bring the stack state into line with what was deployed for it.
m
Sadly, no 😞
😢 1
r
If it's not too late, it occurred to me that you might be able to do something like this:
Copy code
pulumi stack init -s new-stack --copy-config-from=old-stack
pulumi stack rm -s old-stack
pulumi stack rename old-stack -s new-stack
You will end up with a diff on your encryption key, though.
m
I decided just to remove the stack and re-add the secret vars as required, but your method will save me a bit of time, I'll remember it. Thank you 🙂