https://pulumi.com logo
Title
m

mammoth-honey-6147

09/01/2022, 12:59 PM
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

ripe-russia-4239

09/01/2022, 1:01 PM
Are you happy for the resources to be deleted? If so,
pulumi destroy
should do this for you
m

mammoth-honey-6147

09/01/2022, 1:02 PM
Happy with that but these resources were deleted outside of Pulumi and therefore cause issues when trying to remove
r

ripe-russia-4239

09/01/2022, 1:19 PM
Oh! Does
pulumi refresh
sort you out then? That should bring the stack state into line with what was deployed for it.
m

mammoth-honey-6147

09/01/2022, 1:20 PM
Sadly, no 😞
😢 1
r

ripe-russia-4239

09/02/2022, 10:40 AM
If it's not too late, it occurred to me that you might be able to do something like this:
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

mammoth-honey-6147

09/02/2022, 10:42 AM
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 🙂