2

I have several python GAE projects that do not show up with gcloud compute instances list.

I did manage to reserve an IP address which shows in gcloud compute addresses list.

I've explored the Cloud interface and read docs https://cloud.google.com/compute/docs/instances-and-network and I am still at a loss how to make the app originate requests from a static IP address.

hendry
  • 9,725
  • 18
  • 81
  • 139

2 Answers2

4

Ok, it doesn't look possible after eventually finding https://cloud.google.com/appengine/kb/#static-ip

Thanks Google!

hendry
  • 9,725
  • 18
  • 81
  • 139
  • 1
    What did you think how it would work when they said public cloud and automatic scaling? When an application runs on servers distributed around the world how could requests originate from the same IP address? Wouldn't that create one massive bottleneck for the app's traffic and reduce your application to a vertically scaling app? Anyway, if you really want your requests to originate from the same IP I guess you could setup a proxy somewhere and route your requests through it. It wouldn't scale well but it should work. – konqi Mar 22 '16 at 09:16
3

Google App Engine and Google Compute Engine are separate products. The gcloud compute instances list command shows you Compute Engine instances only, which is why you don't not see anything related to App Engine in there.

App Engine does not allow you to assign IP addresses to your project. Among other reasons, App Engine runs 1-n instances of your App, depending upon load and configuration, making a single assigned IP address nonsensical.

If you do require a static IP address for requests to originate from, 2 options you could consider are:

  1. Write your App using Compute Engine instead of App Engine
  2. Proxy your App Engine requests out through your own Compute Engine instance

Without knowing the reason for you requiring a static IP address for egress I can't give you much more advice, other than warning you away from using IP addresses as a security measure. If you are using it to allow/disallow requests, you should consider something along the lines of OAuth instead.

Dan McGrath
  • 41,220
  • 11
  • 99
  • 130
  • Hello Dan, Since, isn't there a sexier solution? I mean, a network solution with cloud router or something? Thanks – Adrien QUINT Nov 21 '19 at 13:46
  • Hello Dan, Is it possible now using CloudNAT as described here ? https://cloud.google.com/appengine/docs/standard/python/outbound-ip-addresses#static-ip – yarin Apr 26 '22 at 11:35