hello, i've got a stack into a bad state and would...
# aws
b
hello, i've got a stack into a bad state and would love some help to get it into any sort of different state (I can't destroy or make changes to the stack currently). I'm getting the error:
Copy code
error: pre-step event returned an error: failed to verify snapshot: resource urn:pulumi:dev::<my-stack>::aws:cognito/userPool:UserPool::<my-user-pool> dependency  refers to missing resource
i've run:
pulumi stack export
and verified that the dependency does, in fact, exist
l
The dependency exists in the stack, or in AWS?
Or both?
b
both
l
Maybe there's a different dependency that is missing? Have you checked all of the user pool's dependencies? There seems to be a double-space in the error message, which makes me think that the dependency that is missing is so amazingly missing that Pulumi has forgotten its URN....
Since it would have "dependecy X refers to missing resource" if it was only ordinarily-missing.. 🙂
b
yeah.. it's only dependency (in the stack) is a lambda function which exists (both in stack and AWS)
but you're saying the whole thing might have been forgotten
the code creating the resource has no additional dependencies, either...
also, in the pulumi web console there is no dependency there (although it exists in the stack output json)
l
Hmm... would there be a "delete" attribute near the beginning of each resource in the exported state?
Or alternatively, does
pulumi preview --show-sames
show that it's going to finish deleting stuff, then show a sparse or empty resource tree?
b
it shows an update to lamdbaConfig (where the "missing dependency" lies) and shows the dependency as "delete"
l
Ok that should be an easy fix. Make a copy of your exported state, find that delete, and delete it. Usually, you can search your state file for
"delete":
and it will find all the things that have been marked for deletion by Pulumi, and which Pulumi thinks it has not yet deleted.
Those lines should all be very near the top of their respective resource definitions, maybe in the top 3 or 4 lines.
If you delete the offending ones (in the copy of your state file), and import that copy, hopefully it'll stop trying to delete them and consider them still in the resource dependency tree.
In case it's not clear: the things you want to delete are just the lines
"delete": "true",
(Or something like that, I don't have an example here..)
b
that may have steered me to a solution - thank you @little-cartoon-10569 🙌
👍 1