Search code examples
google-cloud-platformgoogle-vpc

How do I find which resources use a vpc in GCP?


I want to delete a GCP vpc, I get:

Failed to delete the network. Error: Some of the resources are referenced by other existing resources and cannot be deleted.

How do I determine what these other existing resources are?


Solution

  • The resources that can be using a VPC network are the following:

    • Subnets
    • Static Internal IP addresses
    • Firewall rules
    • Routes (including static and routes created automatically/dynamically)
    • VPC network Peering
    • Private Service connection
    • Instances

    the only way is to check each category manually and make sure that are not using the VPC.

    For more information regarding each kind of resource, visit this documentation [1].

    Cheers!


    [1] https://cloud.google.com/vpc/docs/vpc#specifications