英文:
Determining location of egress traffic in GCP Cloud Functions
问题
我在GCP部署了一个云函数。其中一个函数的操作是向第三方发出HTTP请求。该函数部署在us-central1。我没有设置VPC,并且没有对GCP中的网络选项进行任何修改。
我的一部分对第三方的请求收到了403响应 - 第三方说这些请求是来自澳大利亚的,这就是为什么这些请求导致了403错误。
我的流量不应该源自美国吗?如果不是,我不一定需要给我的函数分配一个静态IP地址,但是否有办法限制我的函数出口流量只能到达特定的地区?如何确定出口流量实际来自哪里?
英文:
I have a cloud function deployed in GCP. One thing the function does is make an http call to a 3rd party. The function is deployed to us-central1. I do not have a VPC setup, and haven't made any modifications to the network options in GCP.
About 1% of my calls to the 3rd party are receiving 403 responses - the 3rd party says those calls are originating in Australia, which is why the calls result in a 403.
Shouldn't my traffic originate in the US? If not, I don't necessarily need a static IP address for my function, but is there a way to limit my function's egress traffic to a specific region? How can I determine where the egress traffic is actually originating from?
答案1
得分: 1
根据@JohnHanley:
> 当您创建GCP帐户时,默认配置了VPC。根据网络服务层概述文档,有两个网络层次:高级和标准。
> 以下是高级和标准的区别:
高级层 | 标准层 |
---|---|
最高性能:在您的VPC网络中,互联网和VM实例之间的流量尽可能在Google的网络中路由。 | 成本优化:在一般情况下,互联网和VPC网络中的VM实例之间的流量经过互联网路由。 |
适用于需要全球可用性的服务。 | 适用于完全托管在某个区域内的服务。 |
仅适用于Google Cloud。 | 性能与其他云提供商相当。 |
高级层是默认设置,除非您进行配置更改。 |
您也可以查看有关设置网络层的文档。
希望对您有所帮助。
英文:
Posting as a community wiki for visibility.
As per @JohnHanley:
> VPC is configured by default when you create a GCP account. There are two network tiers based on this documentation on Network Service Tiers overview; Premium and Standard.
> Below are the differences of Premium and Standard:
Premium Tier | Standard Tier |
---|---|
Highest performance: Traffic between the internet and VM instances in your VPC network is routed by keeping it within Google's network as much as possible. | Cost optimized: Traffic between the internet and VM instances in your VPC network is routed over the internet in general. |
For services that need global availability. | For services hosted entirely within a region. |
Unique to Google Cloud. | Performance is comparable to other cloud providers. |
Premium Tier is the default unless you make configuration changes. |
You can also check this documentation on setting the network tier.
Hope this helps.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论