使用 AWS Route 53 路由到 API 网关

Routing to API gateway using AWS Route 53

我在所有 AWS 区域都有一个 lambda 函数。我的客户遍布全球,他们将 POST 调用我的基本域 example.com。我的(某种)负载均衡器有责任确保将请求路由到离客户端最近的区域的 API 网关,以最大程度地减少延迟。

所以,到目前为止我有以下配置:

在这些配置之后,当我调用 example.com 时,我收到来自 Cloudfront 的 403 响应,称其为 Bad Request

谢谢

截至 2017 年 11 月“亚马逊 API 网关支持区域 API 端点”

https://aws.amazon.com/about-aws/whats-new/2017/11/amazon-api-gateway-supports-regional-api-endpoints/

You can now choose from two types of API endpoints when creating REST APIs and custom domains with Amazon API Gateway. A regional API endpoint is a new type of endpoint that is accessed from the same AWS region in which your REST API is deployed. This helps you reduce request latency when API requests originate from the same region as your REST API. Additionally, you can now choose to associate your own Amazon CloudFront distribution with the regional API endpoint. The second type of API endpoint is the edge-optimized API. Edge-optimized APIs are endpoints that are accessed through a CloudFront distribution that is created and managed by API Gateway. Previously, edge-optimized APIs were the default option for creating APIs with API Gateway.

To get started, create a new REST API using the Amazon API Gateway console, AWS CLI, or AWS SDKs and APIs. You can also migrate existing REST APIs and custom domains to a regional API endpoint. Visit our documentation to learn more about this feature.

This feature is now available in US East (N. Virginia), US East (Ohio), US West (Oregon), US West (N. California), Canada (Central), South America (São Paulo), EU (Ireland), EU (Frankfurt), EU (London), Asia Pacific (Singapore), Asia Pacific (Tokyo), Asia Pacific (Sydney), Asia Pacific (Seoul), and Asia Pacific (Mumbai) AWS regions. Visit our product page for more information about Amazon API Gateway.