Can I get a static IP address for Google cloud features?

I would like to create a Google cloud features endpoint that will subscribe to file changes in the slave Google Cloud Storage and an FTP file to the FTP site of the third part, which assigns white addresses to client IP addresses.

So, can I get a static IP address for Google's cloud function containers?

+15
source share
3 answers

No, this is impossible and is unlikely to ever be. However, you can select a whitelist of all Google IPs.

Where can I find IP Compute Engine ranges? โ†’ Provides a way to access all ips in GCP.

However, be aware of the safety implications.

+4
source

It is not possible to assign a static IP address for Google's cloud functions, since it is largely orthogonal to the nature of the architecture, which is โ€œserverlessโ€, that is, it allocates and frees up servers on demand.

However, you can use HTTP proxies to achieve a similar effect. Configure the Google Compute Engine instance, assign it a static IP address and set the proxy library, for example https://www.npmjs.com/package/http-proxy . Then you can forward all your external API calls, etc. Through this proxy.

However, this probably reduces scale and flexibility, but it can be a workaround.

+1
source

First of all, this is not an unreasonable request, do not refuel. AWS Lambdas already supports this feature and has been working for some time. If you are interested in this feature, check its request: https://issuetracker.google.com/issues/112629904

Secondly, we came to a solution that I also posted in this issue, perhaps this will work for you too:

  • Configure VPC Connector
  • Create Cloud NAT on VPC
  • Create a proxy host that does not have a public IP address, so output traffic is routed through Cloud NAT
  • Configure a cloud feature that uses the VPC Connector and that is configured to use a proxy server for all outgoing traffic

The caveat to this approach: - We wanted to put the proxy server in the managed instance group and behind the internal GCP LB so that it scales dynamically, but GCP support has confirmed that this is not possible because ILB GCP basically whitelists the subnet and the cloud CIDR function is outside this subnet

I hope this is helpful.

Update: just the other day they announced an early access beta for this exact feature !!

"Cloud Functions PM is here. We actually have a preview of this feature if you want to test it.

Please fill out this form so we can add you ... "

The form can be found in the release linked above.

+1
source

All Articles