https://pulumi.com logo
Title
e

eager-lion-7694

03/15/2021, 5:24 AM
i’m trying to destroy resources in my stack, but i get the error that I cant remove a protected resource. How can I bypass this and force delete? Or how can I get a list of all URNs that I can pass to the
--target
option of
pulumi destroy
?
w

white-balloon-205

03/15/2021, 6:55 AM
The goal of protect is to ensure it is not easy to (accidentally) destroy the resource. You can remove the protect bit and then destroy it as two separate operations. https://www.pulumi.com/docs/reference/cli/pulumi_state_unprotect/ can help on the first step.
l

little-cartoon-10569

03/15/2021, 6:56 AM
You need to do it in two steps. 1) Find all the resources with opt
protect: "true"
and remove that. Run
pulumi up
. 2) Run
pulumi destroy
b

better-shampoo-48884

03/15/2021, 2:29 PM
also, for the list of all urns you can just do
pulumi stack -u