简体   繁体   中英

Unable to hit public AWS API gateway endpoints if a VPC Endpoint is created

I am trying to set up a VPC endpoint in an existing VPC. I am able to make calls to the private gateway endpoints from the lambda which is within the VPC.

Problem: When I try to invoke a Regional API gateway endpoint, I am getting a 403. Nat Gateway is setup. I am able to hit the internet via NAT gateway.

I need to call the private endpoint as well as regional endpoints from the lambdas within the VPC

Your VPC endpoint shadows your public API endpoints. From docs :

you cannot access public APIs from a VPC by using an API Gateway VPC endpoint with private DNS enabled

Thus, you can disable private DNS for the VPC endpoint. This way, you will have to explicitly use private VPC endpoint URL in your lambda.

Alternative way to access public API is through :

Note that these DNS settings don't affect the ability to call these public APIs from the VPC if you're using an edge-optimized custom domain name to access the public API

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