gpt4 book ai didi

google-app-engine - 如何在 Google 应用引擎和计算引擎之间建立私有(private)连接?

转载 作者:行者123 更新时间:2023-12-04 16:11:14 25 4
gpt4 key购买 nike

我有一个网络应用程序/Api,目前正在谷歌应用引擎资源上运行。由于 API 的计算非常密集,我已将计算部分外包给一个托管的自动缩放谷歌计算引擎组,在前端有一个 HTTP 负载平衡器(以维护单个 IP 地址并平衡多个 IP 地址之间的负载)动态生成的引擎)。

目前,我只是从应用引擎对负载均衡器 IP 地址进行 HTTP 调用。由于 GAE 和 GCE 位于同一区域,因此感觉效率非常低(我知道应用引擎和计算引擎仍然位于两个物理上分离的数据中心)。这也构成了安全威胁,因为我不断收到来自随机 IP 机器人的调用,试图利用潜在的安全漏洞。此外,我只是在应用引擎级别验证 API token 的有效性,因为我不想让用户数据库访问计算引擎(出于安全原因),所以这意味着应用引擎和计算引擎之间没有进行任何验证,以便后者应答它收到的所有调用。

有没有办法在应用引擎和云引擎之间建立私有(private)连接?

我的目标是不必向整个互联网开放 GCE,记住它只接收来自一个 IP 地址/资源的调用

我曾尝试仅将应用引擎 IP 地址列入白名单,但不幸的是,这是一大块地址,动态检索和更改非常麻烦。应用引擎也不能使用计算引擎/谷歌 SQL 服务器的私有(private) IP。

非常欢迎其他创意!

最佳答案

看起来 Serverless VPC Access可能是一个潜在的解决方案。以下摘自概述:

Serverless VPC Access enables you to connect from the App Engine standard environment and Cloud Functions directly to your VPC network. This connection makes it possible for your App Engine standard environment apps and Cloud Functions to access resources in your VPC network via internal (private) IP addresses. Using internal IP addresses improves the latency of communication between your Google Cloud Platform services and avoids exposing internal resources to the public internet.

Serverless VPC Access only allows your app or function to send requests to resources in your VPC network and receive responses to those requests. Communication in the opposite direction, where a VM initiates a request to an app or function, requires you to use the public address of the app or function.

关于google-app-engine - 如何在 Google 应用引擎和计算引擎之间建立私有(private)连接?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56317017/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com