https://pulumi.com logo
Title
s

silly-address-30441

09/18/2020, 6:57 PM
So I deleted something from the AWS console, and then deleted it from the pulumi config (thinking that it could reconcile the state). But now when I run
pulumi up
, it seems to be failing because it can't delete the resource that isn't there. What's the best way out of this state?
n

nice-airport-15607

09/18/2020, 7:07 PM
i would suggest: 1. deploying with resource back in 2. once that deploys, then comment it out (don’t manually remove from anywhere) 3. re-deploy with it commented out
once it deploys with it commented out, you can then remove it from the code.
for future reference, i would suggest to NEVER manually remove anything created from pulumi from the aws console.
a

abundant-appointment-96790

09/18/2020, 7:08 PM
Or export it to using
pulumi export > stack.json
, remove the deleted resource manually and import the stack back Also to echo the comment above, don’t manually touch your infra unless you’re ready to destroy your stack 🙂
👍 2
n

nice-airport-15607

09/18/2020, 7:09 PM
yes, you could also
pulumi stack export > stack.json
find said resource, remove object, then
pulumi stack import < stack.json
s

silly-address-30441

09/18/2020, 9:58 PM
Btw, thanks! I got this working.
n

nice-airport-15607

09/18/2020, 10:00 PM
👍
f

faint-table-42725

09/18/2020, 11:40 PM
If you’re modifying state purely to delete something, there’s also
pulumi state delete