I'm using Pulumi to deploy some Virtual Machines w...
# google-cloud
d
I'm using Pulumi to deploy some Virtual Machines which have persistent disks attached, so they must be deleted before being replaced (with the
deleteBeforeReplace
option). During one Pulumi run, the VMs were deleted and then another resource failed to be deployed (Cloud Build, build failed -- sometimes common) and during all subsequent runs, Pulumi complains that it cannot replace those Virtual Machines because they do not exist (because it deleted them)
Copy code
error: deleting urn:pulumi:staging::x::gcp:compute/network:Network$gcp:compute/subnetwork:Subnetwork$gcp:compute/instance:Instance::x: 1 error occurred:
	* Error deleting instance: googleapi: Error 404: The resource 'projects/x-c5913e9' was not found, notFound


error: deleting urn:pulumi:staging::keeta-consumer-production-cloud::gcp:compute/network:Network$gcp:compute/subnetwork:Subnetwork$gcp:compute/instance:Instance::y: 1 error occurred:
	* Error deleting instance: googleapi: Error 404: The resource 'y-2506283' was not found, notFound


error: deleting urn:pulumi:staging::keeta-consumer-production-cloud::gcp:compute/network:Network$gcp:serviceAccount/account:Account$gcp:compute/instance:Instance::z: 1 error occurred:
	* Error deleting instance: googleapi: Error 404: The resource 'z-c86f123' was not found, notFound
It seems like that a
pulumi refresh
should help, but it does not:
Copy code
~  gcp:compute:Instance z refreshing (0s) 
...
The VM definitely does not exist within Google Cloud's console either How can I move forward without directly manipulating the Stack state ?
You would also think that if deletion returned
notFound
that it would be considered successful, since the desired state has been achieved