Assigning static IP address to GAE python project

荒凉一梦 提交于 2020-01-03 03:58:05

问题


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.


回答1:


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

Thanks Google!




回答2:


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.



来源:https://stackoverflow.com/questions/36145648/assigning-static-ip-address-to-gae-python-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!