Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to config the api gateway for the service deployed in private subnet?

I deployed a web service in my private subnet without ELB in public subnet.

Now I want to expose it to public. Can I use API gateway as the http proxy

to make it public?

Anyone knows how to do that?

like image 419
Angle Tom Avatar asked Jun 02 '16 02:06

Angle Tom


People also ask

Is API gateway in a subnet?

In the API Gateway service, an API gateway is a virtual network appliance in a regional subnet. Private API gateways can only be accessed by resources in the same subnet.


2 Answers

The service has to be public for API Gateway to be able to connect to it. You can use SSL Client certs to restrict access to only API Gateway. Otherwise, API Gateway would not be a good solution to your issue.

Update: You can now configure API Gateway to access resources inside a VPC using VPC Link.

like image 121
Mark B Avatar answered Sep 23 '22 00:09

Mark B


In addition to @Mark B's excellent answer, you could also consider using a Lambda function as a proxy.

API Gateway -> Lambda -> ELB

You can configure Lambda to access VPC resources. Lambda would have to buffer the entire result before returning it, so this would slow down large responses.

like image 25
Jason Avatar answered Sep 22 '22 00:09

Jason