Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EC2 could not resolve private API Gateway

The current set up is:

  • EC2 instance deployed in a VPC in subnet A.
  • VPC Endpoint for execute-api in the same VPC in the same subnet (A)
  • Private API Gateway with a resource policy to Allow both the VPC and VPC Endpoint to invoke the API

VPC has all its DNS settings enabled. DNS Hostnames & DNS resolution.

VPC Endpoint and EC2 instances both have allowed all traffic to port 443.

What am I missing here? The EC2 instance cannot seem to resolve the API via its https://(api ID).execute-api.(region).amazonaws.com/(api)

like image 351
oasisofthestar Avatar asked Oct 25 '25 04:10

oasisofthestar


1 Answers

Very late on this, but for anyone else googling the correct link is : https://{api-id}-{vpc-endpoint}.execute-api.{region}.amazonaws.com/{stage}/.

I believe the issue in the original post here is the vpc-endpoint id is missing from the link. I've seen that incorrect format referenced in a few places, I don't know then but it definitely won't work without it now.

like image 141
Kevin Avatar answered Oct 26 '25 17:10

Kevin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!