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

ambitious-battery-86624

08/01/2021, 8:31 PM
I have a dynamic resource where I forgot to save an API key after creation. Now I can't delete it anymore, and Pulumi doesn't destroy the stack. I can delete the resource from the cloud provider manually, but how to I get it out of the stack again?
p

proud-pizza-80589

08/01/2021, 8:34 PM
pulumi stack export >tmp.json then remove it from the json and pulumi import --file tmp.json
a

ambitious-battery-86624

08/01/2021, 8:35 PM
thanks!
hm no, the resource won't go away
p

proud-pizza-80589

08/01/2021, 8:42 PM
the json that comes out β€œis” the stack, so if you remove something from it, pulumi forgets about it
a

ambitious-battery-86624

08/01/2021, 8:43 PM
Yes, I removed two objects from it, a default dynamic resource and my specific resource
hmhm, I fixed it by updating the proviser and making the delete a nop
Then I removed the actual resource manually from my cloud
thanks anyway, I guess that command will be helpful in the future :)
πŸ™Œ 1