AWS API 网关:为 public 访问和私人访问创建一个 API

AWS API Gateway: Create one API for both public access and private access

我想实现以下这些。有什么好的方法?

我面临的问题

预期结构

无法创建一个 AWS REST API 网关,它既是私有的又是 public(区域或边缘优化)。您将必须创建两个单独的 API 网关。就后端集成而言,您可以在两个 API 网关中使用相同的配置。

如果您在使用 SDK/CLI 时尝试为 CreateRestAPI operation 指定两个端点类型,您将收到以下错误:

An error occurred (BadRequestException) when calling the CreateRestApi operation: Cannot create an api with multiple Endpoint Types.