awslabs / aws-api-gateway-developer-portal

A Serverless Developer Portal for easily publishing and cataloging APIs
Apache License 2.0
929 stars 401 forks source link

Add support for APIs using private endpoints/VPC Links #209

Open avieira-inv opened 5 years ago

avieira-inv commented 5 years ago

When we add an API to the developer portal, where the defined integration type within AWS API Gateway is VPC Link, aka private endpoint, it is not possible to send a test request to that API (Try me now! button) because a curl command is automatically generated using the API's public endpoint. In this case the request needs to be internal, meaning that the target request should be the VPC Link endpoint, along with the Host header specifying the API public identifier endpoint.

Example:

Request URL: https://<myvpclink>/<stage>/<resources>
HOST: <APIKey>.execute-api.<region>.amazonaws.com

The information concerning vpc link, stage, resources and public api endpoint is already defined within AWS API Gateway, meaning that a possible solution could be to include this information, along with the VPC link info, into the exported openapi/swagger file and extend the logic that auto generates the curl command.

This is not as simple as updating the curl command, because there's a connectivity issue, meaning that the existing logic behind AWS API Gateway, to use VPC Links, would need to be added to the DEV Portal.

maierthomas commented 2 years ago

+1 would like to share and mainly test my private API's within the developer portal!