gpt4 book ai didi

amazon-web-services - 如何在启用 NAT 的子网中使用 AWS VPC 终端节点?

转载 作者:行者123 更新时间:2023-12-04 00:21:13 24 4
gpt4 key购买 nike

我正在使用一些位于私有(private)子网中的 AWS Lambda 函数,
这些私有(private)子网为函数需要访问的服务配置了 VPC 终端节点,
当前设置不使用 NAT 网关,因此来自函数的所有流量都通过 VPC 终端节点。

我现在有一个用例,我们需要使用 NAT 网关,
但是启用 NAT 是否意味着函数将不再使用 VPC 端点进行外部服务访问,而是使用 NAT?

最佳答案

我认为这如下工作。为了:

网关端点(S3、DynamoDB)

当您创建它们时,它们的路由会自动添加到我们的路由表中。文档 says :

If you have an existing route in your route table for all internet traffic (0.0.0.0/0) that points to an internet gateway, the endpoint route takes precedence for all traffic destined for the service, because the IP address range for the service is more specific than 0.0.0.0/0. All other internet traffic goes to your internet gateway, including traffic that's destined for the service in other Regions.



接口(interface) VPC 端点

它们通过修改服务的 DNS 中的 IP 地址来工作。 IP 地址将是端点接口(interface)的私有(private)地址。文档 says :

The hosted zone contains a record set for the default DNS name for the service (for example, ec2.us-east-1.amazonaws.com) that resolves to the private IP addresses of the endpoint network interfaces in your VPC. This enables you to make requests to the service using its default DNS hostname instead of the endpoint-specific DNS hostnames.

To use private DNS, you must set the following VPC attributes to true: enableDnsHostnames and enableDnsSupport.



结论

所以在这两种情况下,优先考虑的是接口(interface),而不是互联网。我建议检查提供的链接。他们有更多信息和例子来仔细检查我的结论。

关于amazon-web-services - 如何在启用 NAT 的子网中使用 AWS VPC 终端节点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60521065/

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