https://pulumi.com logo
#general
Title
# general
q

quaint-queen-45003

09/20/2019, 6:35 PM
so im an idiot and deleted an EKS cluster from the aws UI and now my pulumi stack is busted. is there any way of recovering this?
b

brash-plastic-65797

09/20/2019, 6:38 PM
manually deleting resources will cause your pulumi state to get out of sync. you can use “pulumi refresh” to re-sync your state, but do some research on that command before running
q

quaint-queen-45003

09/20/2019, 6:40 PM
i tried a refresh but that didn't seem to work. it threw a bunch of errors trying to connect to the (now non existent) cluster
b

brash-plastic-65797

09/20/2019, 6:41 PM
have you tried commenting out the cluster from your pulumi script, and applying that
once the state is back in sync you can add that cluster back
not sure if this is a production environment you are working on, but if its dev or staging obviously less harm in trying
q

quaint-queen-45003

09/20/2019, 6:42 PM
trying that now
no luck unfortunately
c

cool-egg-852

09/20/2019, 6:50 PM
You can do a
pulumi stack export -s Org/StackName --file stack.json
and edit the file. Then run
pulumi stack import -s Org/StackName --file stack.json
Just remove the resources that don’t exist anymore
w

white-balloon-205

09/20/2019, 7:17 PM
Or use
pulumi state delete '<urn-for-the-resource>'
to remove it from the checkpoint.
q

quaint-queen-45003

09/20/2019, 7:18 PM
would that also update state for the existing resources? i noticed in the stack export that there are a lot of
parent
references to the urn
This resource can't be safely deleted because the following resources depend on it
im guess i need to
pulumi state unprotect
first
would that be recomended so that i can atleast fix up my state to delete all of the other orphaned resources?
we got it sorted out. took a bunch of cleaning of a stack export
thanks all for the suggestions!