When I export a stack to json, remove resources fr...
# general
r
When I export a stack to json, remove resources from the json and try to import it later, no changes are shown, what could be the reason for this?
p
what do you mean by no changes?
as far as I understand, if you modify the state manually (remove some resources), they are not managed anymore by pulumi (regardless of the fact whether they still exist or not)
what did you try to achieve?
r
I wanted to delete resources manually
so I exported the stack
deleted the resources
and imported it again
but the resources weren't removed when I looked into the pulumi console
p
just to make sure, you: • exported the stack to JSON • removed some resources manually from JSON • removed these resources from the cloud • import the modified JSON file
did you run
pulumi up
after all this?
r
multiple times now, since it didn't remove my resources
I had to add some hardcoded resource IDs and run pulumi up a few times, to get things in the correct oder
p
by
multiple times now, since it didn't remove my resources
you mean from the pulumi console?
and not the cloud resources
r
hm
what I did was
I deployed a resource, but because of a bug, it was missing some inputs that I needed to delete it anymore
then I exported the stack and tried to remove the resource from the pulumi stack
then I imported the stack again, but the import command said, no resources are affected
and in the pulumi console, the resources were still in the stack
then I rewrote my dynamic resource provider, so it had the missing inputs hardcoded
ran pulumi up every time I changed the hardcoded values for the next resource to delete etc.
now the resources are gone from my stack, but I'm still confused why I couldn't delete it with an export/import