Hello, I accidentally manually deleted a resource ...
# general
Hello, I accidentally manually deleted a resource created by pulumi infrastructure, I am sure that the resource I delete doesnt have dependency on any other resource. Can I use "pulumi delete state 'urn of the resource I deleted' " to get rid of it from the state ?
I’d try to run
pulumi refresh
to refresh the pulumi state based on the current state in the cloud. You can backup the state just in case using
pulumi stack export
I get this error for any commands I will try
Copy code
.pulumi/stacks/Staging.json: snapshot integrity failure; refusing to use it
the cloud state currently doesnt match the state in the Staging.json as the resource in cloud was deleted manually
you can
pulumi stack export
then modify the stack.json to reflect reality, and then
cat stack.json | pulumi stack import
Thanks let me try the same
@millions-furniture-75402 I have got the json file with the correct state, the latest file being referred for state is in s3 bucket. Would replacing the state json in the s3 bucket with the one I want work?
Why wouldn't you use
pulumi stack import
well replacing old state json file with the correct state file worked for me, I just replaced it in s3 bucket with same name
👍 1
Thanks @millions-furniture-75402