*How do I delete a subnet group which is used by a...
# aws
How do I delete a subnet group which is used by a RDS instance? I got this error for `pulumi destroy`:
Destroying (staging):
Type                    Name                    Status                  Info
*`pulumipulumiStack myapp-infra-staging failed 1 error`* *`- └─ awsrdsSubnetGroup rds-subnet-group deleting failed 1 error`*
aws:rds:SubnetGroup (rds-subnet-group):
error: deleting urn:pulumi:staging::myapp-infra::aws:rds/subnetGroup:SubnetGroup::rds-subnet-group: 1 error occurred:
` deleting RDS Subnet Group (rds-subnet-group-84e29cf): InvalidDBSubnetGroupStateFault: Cannot delete the subnet group 'rds-subnet-group-84e29cf' because at least one database instance: myapp-staging is still using it.`*
status code: 400, request id: 2d691633-f9eb-4bf9-969c-f4db4ac4ee89
pulumi:pulumi:Stack (myapp-infra-staging):
error: update failed
Try doing a targeted destroy against the database first by passing the urn of the resource in. You can get this by running
pulumi stack -u
and then
pulumi destroy -t resource_urn