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

Do projects that use only serverless functions require a VPC

If my project is using only serverless functions/applications, do I still need a VPC?  In other words the project does not have any VMs. 

Example - The project only uses API gateway, cloud functions, pub/sub and BigQuery.

Solved Solved
0 4 427
2 ACCEPTED SOLUTIONS

Yes, my understanding is that you don't need to create or specify a VPC when using serverless functions.

On a related note, you can create VPC access connectors, to enable your serverless functions to connect to other resources in VPCs.

View solution in original post

As described in this doc, you can...

...disable the creation of default networks by creating an organization policy with the compute.skipDefaultNetworkCreation constraint. Projects that inherit this policy won't have a default network.

View solution in original post

4 REPLIES 4

Yes, my understanding is that you don't need to create or specify a VPC when using serverless functions.

On a related note, you can create VPC access connectors, to enable your serverless functions to connect to other resources in VPCs.

Thanks for the response. One follow-up question -- When creating a project, a default VPC is created automatically.  So how do I create a project without a default VPC? I presume a command line option is available?

As described in this doc, you can...

...disable the creation of default networks by creating an organization policy with the compute.skipDefaultNetworkCreation constraint. Projects that inherit this policy won't have a default network.

Thanks! Will try this out.