https://pulumi.com logo
#typescript
Title
# typescript
r

refined-terabyte-65361

10/20/2021, 8:05 PM
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

little-cartoon-10569

10/20/2021, 8:07 PM
Have you tried removing the
protect
flag, rather than setting it to
false
?
r

refined-terabyte-65361

10/20/2021, 8:07 PM
ya
l

little-cartoon-10569

10/20/2021, 8:07 PM
Actually, from the error message, it looks like you've removed the code, rather than changed the flag. Is that correct?
r

refined-terabyte-65361

10/20/2021, 8:07 PM
tried that but it still gives error
l

little-cartoon-10569

10/20/2021, 8:08 PM
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

refined-terabyte-65361

10/20/2021, 8:09 PM
oh sure i will try running separately and see if i am able to fix this
👍 1
Thanks works as expected
🎉 1
4 Views