I have created public API using AWS api gateway with the resource cars
and a GET
method. I also have backend API,/api/routing
, that is hosted on EC2 windows instance. The backend API only accepts POST
request and used for routing the request based on some header values.
In integration request i also have Mapping Template setup so it can POST data to api/routing
So the integration request for cars
public API looks like below
The Inbound rules for EC2 instance
Issue
The Endpoint URL is using private ip of EC2 instance. When i Test cars
api i get error
Execution failed due to configuration error: Invalid endpoint address
If i change the Endpoint Url to use public ip address then its working as expected
Eventually, i would like to access backend API using private-ip. The EC2 instance is a free instance that AWS created.
I understand that if i have VPC then in API Gateway i need to setup VPC Links, but I have not created any VPC.(unless aws by default creates one).
internal
NLB instead ofpublic
. Because I think, the client for EC2 instance is API Gateway. However that did not work – LP13