Google Cloud Platform - Find Resource by Full Resource Name

How do I take a full resource name, such as projects/<project_id>/global/networkInstances/<instance_id>, and find out more about it with just that information?

I am currently trying to delete the default network from one of my existing GCP projects. running gcloud compute networks delete --quiet default resulted in this error:

- The network resource 'projects/<project_id>/global/networks/default' 
is already being used by 'projects/<project_id>/global/networkInstances/<instance_id>'

I've looked everywhere I can think of, and I cannot find any resources within the default network, so I'm hoping I can use this resource name to learn more about it.


As per my understanding VPC network consists of:

  1. Subnets
  2. Static Internal IP addresses
  3. Firewall rules
  4. Routes (including static and routes created automatically/dynamically)
  5. VPC network Peering
  6. Private Service connection
  7. Instances

On of the prerequisite of deleting VPC network is, you must delete all resources in all of its subnets, and all resources that reference the network. Resources that reference the network include Cloud VPN gateways, Cloud Routers, firewall rules, and custom static routes.

I would recommand deleting any manually added configuration ( Custom static routes, VPC peering, Private service connections etc) for that VPC network before trying deleting it.


Like userX said you need to delete all of below resources referring to that VPC But there is another things -

  1. Subnets
  2. Static Internal IP addresses
  3. Firewall rules
  4. Routes
  5. VPC network Peering
  6. Private Service connection
  7. Instances

So if you confirms that error is not because of above 1 to 7 items, Then check if you have any

  1. Cloud Run
  2. Cloud Task
  3. App Engine service with redis cache implementation

In my case problem was because of App engine (standard) Java service which was reffering to deleted redis cache which needs serverless VPC and serverless VPC needs VPC. Even though serverless VPC, Redis instance was deleted that app engine instace was not allowing me to delete VPC.

So just try that as well.