Google Cloud Function IP Address setting

Hi there, I have some google cloud functions running well until last night they broke. It turned out that the API provider (Binance in my case) restricted U.S. IP addresses from accessing their data.

On my local computer, I can use VPN (connecting to Singapore) to run the same code successfully.

I wonder if anyone can help me to do the same thing in Google Cloud.

Many thanks!

1 7 1,392
7 REPLIES 7

I have exactly the same problem. Any help would be much appreciated. 

Perhaps I can elaborate a bit from my side. I had a pub/sub cloud function deployed to us-east1 and until recently everything worked fine. Then, the above described IP ban from Binance happened and broke everything.

As a response to this, I changed the region of my cloud function to asia-east2 and to europe-west1 but nothing changed.

Apparantly the ip address of my outgoing API calls is still considered to be in the U.S. Is this intended behavior or can I change this somehow?

Any solution to this? I also changed the region to asia-northeast1 but it did not work.

any solution to this?

Unfortunately, all External IP addresses provided by GCP will always show that it is hosted in Mountain View (which is the Google headquarters), which is why changing to any region but US doesn't work. This has been discussed in a similar thread

For now, there are no workarounds for this since Binance is the one imposing the ban.

no workarounds yet? i notice that simple request in the browser like: https://fapi.binance.com/fapi/v1/time return response fine . Could this be used in any way. my ISP is in Mexico by the way.

Well, run your own virtual load balancer on K8S or Compute Engine.  Install it with a Linux OS, throw your VPN on it, use HAProxy or some other performant load balancer.  You would need to know how to use shell for Compute Engine or how to build out a K8S node I guess.