https://pulumi.com logo
Title
s

square-dress-80180

06/03/2021, 11:04 PM
I ran into a weird issue where trying to
pulumi destroy
an rds instance and related subnet group ran into a problem where it seemed like pulumi thought it had stopped the rds instance, but actually hadn’t. So was receiving an error like this:
InvalidDBSubnetGroupStateFault: Cannot delete the subnet group 'cookie-db-sng-9fd6b64' because at least one database instance: cookie-db-rds05a1a02 is still using it.
So, stopped and deleted the rds instance manually since it was no longer “in” pulumi state from what I could tell. Tried to
pulumi refresh
and
pulumi destroy
again but no luck. I have been able to use
pulumi destroy
to successfully delete the infra resources - internet gateway, subnets, vpc. But still the subnet group insists there is an rds instance still up and it is in use. Any ideas on how to proceed?
It gets weirder … if I
pulumi state delete
the resource urn for the subnet group that comes directly with the error message above, I get the following:
no such resource exists in current state
l

little-cartoon-10569

06/03/2021, 11:31 PM
Looks like the error is coming only form AWS and not Pulumi? Pulumi is all clean but the SubnetGroup and RDS instance are still in AWS?
s

square-dress-80180

06/07/2021, 4:29 PM
those resources were deleted manually in the aws console though. Are you saying @little-cartoon-10569 that Pulumi is getting the error from an api call to aws to confirm that the subnet group can be deleted? I am not clear whether it is pulumi
state
or aws
state
that is the referenced state in
InvalidDBSubnetGroupStateFault
.
nm - It seems like I had only “stopped” the rds instance and not actually “deleted” it. Once deleted the
pulumi destroy
cmd worked fine.
It still is confusing to me why pulumi would think it had deleted the rds instance if it wasn’t actually deleted and then try to move on to the related subnets.
l

little-cartoon-10569

06/07/2021, 8:56 PM
This is the downside of fully async systems. RDS databases can take a long time to delete, and in many cases, simply will not delete (e.g. if multiAZ is on) but won't tell you immediately. How long does Pulumi wait to find out?
I think most of the time, Pulumi works off the response to the initial request. If Pulumi sends a "delete" request to RDS, and RDS responds with "right-o, I'll get right on that", then Pulumi may have to assume that the DB will eventually be deleted...
s

square-dress-80180

06/22/2021, 3:39 PM
(A very belated) Thanks @little-cartoon-10569 for the info!
👍 1