Support for Direct VPC egress for v2 Cloud Functions
[REQUIRED] Environment info
firebase-tools: 14.4.0
Platform: macOS
[REQUIRED] Test case
Try to use Direct VPC egress for v2 cloud functions, e.g.
export const uploadData = onRequest(
{
region: "europe-west1",
memory: "256MiB",
minInstances: 0,
timeoutSeconds: 60,
vpcConnectorEgressSettings: "PRIVATE_RANGES_ONLY",
}, async (request, response) => {
try {
[REQUIRED] Steps to reproduce
- Deploy function with the following settings
- Go to GCP console to the cloud function v2 details
- See that VPC network is not enabled
[REQUIRED] Expected behavior
It should be possible to use Direct VPC access via firebase CLI so that the default VPC network is selected after deploying.
[REQUIRED] Actual behavior
No VPC access from v2 Cloud Function
Hi, thanks for raising this, it's been received. We will provide updates when available.
I think there might be a workaround, after deploying you could run:
gcloud run services update uploadData \
--project=YOUR_PROJECT_ID \
--region=europe-west1 \
--network=default \
--subnet=default \
--vpc-egress=private-ranges-only
Can you let me know if this workaround works for you?
I will raise the issue with the team though. Thanks for bringing to our attention.
Yes, I can change the network settings after the deployment via gcloud cli or GCP console. The issue is not super urgent but would be much more convenient to set it via firebase cli or function configuration
+1 on this. Looking to connect my firebase functions to a memorystore instance
+1 on this as well! Having to change the settings every time I deploy is inconvenient. I've decided to use the VPC connector until direct vpc configuration is supported in cloud-functions.
This will be really handy
Bump.
I'm missing this too.
It would be really nice if we could configure Direct VPC in code, rather than hacking every time with this workaround: https://github.com/firebase/firebase-tools/issues/8633#issuecomment-2945386596