如果创建了 VPC 端点,则无法命中 public AWS API 网关端点

Unable to hit public AWS API gateway endpoints if a VPC Endpoint is created

我正在尝试在现有 VPC 中设置 VPC 端点。 我能够从 VPC 内的 lambda 调用私有网关端点。

问题: 当我尝试调用区域 API 网关端点时,我收到 403。 Nat 网关已设置。我可以通过 NAT 网关上网。

我需要从 VPC 中的 lambda 调用私有端点和区域端点

您的 VPC 端点隐藏了您的 public API 端点。来自 docs:

you cannot access public APIs from a VPC by using an API Gateway VPC endpoint with private DNS enabled

因此,您可以为 VPC 端点禁用 private DNS。这样,您将必须在您的 lambda 中显式使用私有 VPC 端点 URL。

另一种访问 public API 的方法是 through:

Note that these DNS settings don't affect the ability to call these public APIs from the VPC if you're using an edge-optimized custom domain name to access the public API