How do I define a custom domain name for my Amazon API Gateway API with Private endpoint type

折月煮酒 提交于 2019-12-11 19:36:57

问题


We are setting API Gateway to be accessible only inside VPC or VPC endpoints. In AWS API Gateway you can create a custom domain with Edge or Regional configuration. Is there any way somehow point map DNS name from Route53 to API Gateway "ugly" DNS name for Private type or to VPC Endpoint DNS name but with setting the header parameter automatically(it's also possible to send request VPC Endpoint but with specifying header: <APIGW DNS>)?


回答1:


This is not possible.

Custom domain names are not supported for private APIs.

https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-private-apis.html

If you really wanted this functionality, it could be accomplished with a proxy server (e.g. HAProxy or Nginx) running inside the VPC that accepts requests for the custom domain and forwards requests to the API Gateway private endpoint using the correct Host header and the correct TLS SNI... but this increases complexity and creates an additional dependency in your stack that seems unjustifiable just for the purpose of having a non-ugly domain name for an API that is only consumable internally.



来源:https://stackoverflow.com/questions/56540149/how-do-i-define-a-custom-domain-name-for-my-amazon-api-gateway-api-with-private

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!