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

Time:02-02

I would like to achieve these below. What are good ways?

  • Make one API on API Gateway. (I prefer one API over two APIs to save maintenance cost.)
  • The API can be accessed from the internet.
  • The API can be accessed from the VPC without data transfer out charges. (Expected structure

    CodePudding user response:

    It is not possible to create one AWS REST API Gateway which is both private and public (either regional or edge optimized). You will have to create two separate API Gateways. You can have the same configurations in both API Gateways in terms of backend integrations.

    If you try to specify two endpoint types for the CreateRestAPI operation when using a SDK/CLI you would get the following error:

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

  •  Tags:  
  • Related