How can I route api gateway endpoint to ec2 private IP

Viewed 895

I have deployed django app on ec2.I am only allowed to use private IP for ec2. So my endpoint is only accessible in our vpn. Now there is requirement like some of external applications want to use some of backend endpoints of that django application. So we want to have open endpoint secured with mechanism like apikey. Is there any way to do this? I am thinking like creating api endpoint which will route to the ec2 enpoint. But Not sure how we can allow apigateway to access that endpoint.

1 Answers

You can achieve that through API Gateway private integrations. This will require you to setup VpcLink between your API and VPC, as well as Network Load Balancer (NLB) which the API connects to. The NLB then will connect to your private EC2 instance.

Related