'Unknown error. Operation failed: VPC Access did not have permission to resolve the subnet or the provided subnet does not exist

Original error message: Operation failed: VPC Access did not have permission to resolve the subnet or the provided subnet does not exist.

Steps Followed:

  1. Created a new Project la-gcp-cloud-run-demo
  2. Created a subnet in the network with CIDR range 10.8.0.0/28
  3. Created a VPC Connector using the subnet 10.8.0.0/28

Note : While creating the same Connector on la-gcp-cloud-run-demo, On other projects like la-gcp-corp an ls-gcp-test.

enter image description here



Solution 1:[1]

I've just recently encountered the same issue as yours. I am assuming that you are connecting the projects via Shared VPC.

You missed 2 steps from your original one:

Steps Followed:

1. Created a new Project la-gcp-cloud-run-demo
2. Created a subnet in the network with CIDR range 10.8.0.0/28
3. Created a VPC Connector using the subnet 10.8.0.0/28

4. Navigate to your target project and enable Serverless VPC API -- Once enabled, go to IAM Permissions and copy the freshly created gcp-sa-vpcaccess.iam.gserviceaccount 5. Go to your Shared VPC Host project and add your new gcp-sa-vpcaccess.iam.gserviceaccount under IAM add set the role as networkUser

Once you have the right permissions, you will be able to create Connectors without any problem.

Hoping this helps!

Solution 2:[2]

this happened to me today i have to made an account with this format in the "host vpc" @cloudservices.gserviceaccount.com , you have to puto the account ID not the name, the account is in twelve digits. Give to this network user role.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 bhans1
Solution 2 Joanale273