Carla Harris
Carla Harris

Reputation: 83

Internal only HTTP Cloud Function unreachable

I am trying to set up a HTTP Cloud Function that allows only internal traffic, as explained in Google’s public docs.

However, when I try to access the function from a GCE instance that does not have an external IP address it does not work, and gives me the following error:

Image

As you can see in the following screenshots, I have both the Function and the GCE instance in the same region:

Functions

GCE network interface

This project only has 1 VPC network, which is the default one, and the source code for the Cloud Function is the default suggestion of the Console:

Source code

Strangely enough, if I give an external IP address to the GCE instance it works, so does it mean that the traffic is still going to the internet?

Upvotes: 2

Views: 819

Answers (1)

Jasper
Jasper

Reputation: 1795

If a compute engine lacks an external IP, it can only send packets to other internal IP address destinations. You still have to connect to a set of external IP addresses used by Google APIs and services. This can be done by enabling Private Google Access on the subnet used by the VM/function

enter image description here

Documentation: https://cloud.google.com/vpc/docs/configure-private-google-access

Upvotes: 4

Related Questions