so im an idiot and deleted an EKS cluster from the...
# general
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?
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
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
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
trying that now
no luck unfortunately
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
Or use
pulumi state delete '<urn-for-the-resource>'
to remove it from the checkpoint.
would that also update state for the existing resources? i noticed in the stack export that there are a lot of
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
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!