Hello, I accidentally manually deleted a resource ...
# general
r
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 ?
p
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
.
r
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
m
you can
pulumi stack export
then modify the stack.json to reflect reality, and then
cat stack.json | pulumi stack import
r
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?
m
Why wouldn't you use
pulumi stack import
?
r
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