简体   繁体   中英

I can't access an AWS API Gateway from inside a VPC

I have a public AWS API Gateway.

I have a server in a VPC the same region as that API gateway. The server cannot access endpoints of that API gateway. Requests to the gateway hang and time out. The server can access API gateways in other regions of the same AWS account just fine.

Servers in VPCs in other regions can access the API gateway just fine. My local computer can access the gateway just fine. The only thing that can't access the gateway is a server in the same region.

What is going on?

The problem is that the VPC has a VPC endpoint overriding the destination of execute-api.xxxxxxx.amazonaws.com with private DNS enabled. This happens when you follow the instructions for creating a Private API in API gateway . AWS doesn't let you (easily) mix accessing private and public API gateways from the same VPC.

To fix this:

  1. Change all your gateways in that VPC to public
  2. Go to the VPC and delete the offending VPC endpoint (it is the one that is overriding the destination of "execute-api.xxx.amazonaws.com")

Alternatively, move your public APIs to a different VPC.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM