https://pulumi.com logo
#general
Title
# general
b

breezy-kangaroo-6997

11/10/2023, 1:14 PM
i try this pulumi state delete but i need to delete almost all the resources 😕
g

gentle-application-59272

11/10/2023, 2:58 PM
you may need to script it, i've had to do that before
use
pulumi stack -u > resources.txt
to get everything, then go through & extract out the things that need deleting
then you can do something like
Copy code
while read resource; do
  pulumi state delete --target-dependents "$resource"
done < resources.txt
though do be very careful. You can add
-y
to make it do that automatically
just ... yeah be careful man
easy foot gun, that
maybe a good idea to manually backup your state file before you do any of that
b

breezy-kangaroo-6997

11/14/2023, 1:12 PM
Yes but you cannot do it in production this
g

gentle-application-59272

11/15/2023, 11:51 AM
why not
b

breezy-kangaroo-6997

11/15/2023, 1:56 PM
in production if you remove a resource then it will not be replace after ?
g

gentle-application-59272

11/21/2023, 4:56 PM
in production if you remove a resource then it will not be replace after ?
not if you get rid of the code in the pulumi project too?