Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Not able to delete vpc network

i have deleted all the resources associated with the vpc still getting below error.

 

Operation type [delete] failed with message "The network resource 'projects/crypto-monolith-402302/global/networks/myvpc-1' is already being used by 'projects/crypto-monolith-402302/regions/us-central1/routers/test'"
 
Kindly help me resolve
3 1 440
1 REPLY 1

Hi @ifra_thabassum ,

To delete the VPC network, you will need to delete the router that is using it first.

If you are still having trouble deleting the VPC network, make sure that you have deleted all other resources that are associated with it, such as subnets, firewall rules, and VPN gateways. You can check for any remaining resources by running the following command in the Cloud Shell:

gcloud compute firewall-rules list --filter="network:myvpc-1"
gcloud compute routes list --filter="network:myvpc-1"
gcloud compute addresses list --filter="network:myvpc-1"
gcloud compute forwarding-rules list --filter="network:myvpc-1"
gcloud compute global-forwarding-rules list --filter="network:myvpc-1"
gcloud compute target-http-proxies list --filter="network:myvpc-1"
gcloud compute target-https-proxies list --filter="network:myvpc-1"
gcloud compute target-ssl-proxies list --filter="network:myvpc-1"
gcloud compute url-maps list --filter="network:myvpc-1"
gcloud compute global-operations list --filter="network:myvpc-1"

Replace myvpc-1 with the name of your VPC network. If any of these commands return results, you will need to delete the corresponding resources before you can delete the VPC network. Let me know if this helps.