I there a way to delete every entry in a stacks `s...
# general
I there a way to delete every entry in a stacks
? 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.
Are you happy for the resources to be deleted? If so,
pulumi destroy
should do this for you
Happy with that but these resources were deleted outside of Pulumi and therefore cause issues when trying to remove
Oh! Does
pulumi refresh
sort you out then? That should bring the stack state into line with what was deployed for it.
Sadly, no 😞
😢 1
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.
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 🙂