https://pulumi.com logo
Title
h

handsome-state-59775

04/15/2021, 5:47 AM
i'm trying to destroy a test stack, in which i have marked a lot of resources as protected. how can i easily list these URNs, so i can do something like
pulumi state list | grep protected | xargs -I{} pulumi state unprotect {}
?
βœ… 1
r

red-match-15116

04/15/2021, 6:03 AM
pulumi stack export
might be the closest thing to what you want
πŸ‘ 1
h

handsome-state-59775

04/15/2021, 6:21 AM
pulumi stack export | jq '.deployment.resources[] | select(.protect == true) | .urn' | xargs -I{} pulumi state unprotect {}
^ this works, but is sooo slooowwwww... 4.5 mins for 12 resources anything i can do to speed this up safely?
😰 1
r

red-match-15116

04/15/2021, 6:29 AM
pulumi state unprotect --all
?
πŸ‘€ 1
h

handsome-state-59775

04/15/2021, 6:40 AM
17 seconds! Wow, thanks!
i wonder what is being done under the hood to make this possible. concurrent updates? request batching?
b

broad-dog-22463

04/15/2021, 8:10 AM
The issue with doing this one at a time is that each change becomes its own change set and pushes a change in your state, using the command Komal pointed out means we handle it internally and it’s only 1 change to the state :) so only 1 diff that needs to be pushed to the backend
πŸ’― 1
πŸ‘ 1
p

proud-pizza-80589

04/24/2021, 8:25 AM
i did stack export, search and replace in vs code, and then stack import πŸ™‚ Simple and fast
πŸ’― 1
✨ 1