How to unprotect a resource I set protect: true, ...
# typescript
r
How to unprotect a resource I set protect: true, to one of my resource now its preventing me from upgrading to latest version i tried setting protect: false but still update fails
Copy code
error: Preview failed: unable to delete resource "urn:pulumi:raj-eks::eks::aws:eks/addon:Addon::eksAddon"
    as it is currently marked for protection. To unprotect the resource, either remove the `protect` flag from the resource in your Pulumi program or use the command:
    `pulumi state unprotect urn:pulumi:raj-eks::eks::aws:eks/addon:Addon::eksAddon`
i dont have access to run
Copy code
pulumi state unprotect urn:pulumi:raj-eks::eks::aws:eks/addon:Addon::eksAddon
is it possible to fix this without running
Copy code
pulumi state unprotect urn:pulumi:raj-eks::eks::aws:eks/addon:Addon::eksAddon
l
Have you tried removing the
protect
flag, rather than setting it to
false
?
r
ya
l
Actually, from the error message, it looks like you've removed the code, rather than changed the flag. Is that correct?
r
tried that but it still gives error
l
If you change the flag and remove the code at the same time, then effective you haven't changed the flag, so the error remoains.
The process requires two `up`s: one where you only change the flag, then a 2nd one where you remove the code and thus the resource.
1
r
oh sure i will try running separately and see if i am able to fix this
👍 1
Thanks works as expected
🎉 1