Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting AWS Api Gateway and private ALB

I have a task to configure API Gateway to route traffic to Lambda or to Load Balancer(internal, under VPC). I thought that it would be possible to create simple integration for ALB using simple HTTP integration or AWS Service. But after some time of googling I found only one solution - is to configure NLB and then use VPC_Link integration. In this case everything looks like working.

But still I found some articles like this one where people describe how they can integrate Api Gateway and LB without VPC_links. In my case I always see invalid endpoint address error when integrate my internal ALB with my apigateway. I suppose that this works only for public resources(internet facing LBs)?

And second part of question. When I configured VPC_link I still need to provide some endpoint in integration for certificate checks and something else. But looks like this endpoint still must be publicly accessible? The problem is that my service under ALB have multiple endpoints and I need to provide Path to this endpoints in this Endpoint URL and this endpoint should be public as I see right now. So for test reasons I provided url of our public resource and path of endpoint that I need to execute. And this works but looks too ugly for me. May be there is any pretty solution.

like image 761
Aleksei Bulgak Avatar asked Jun 10 '18 10:06

Aleksei Bulgak


People also ask

Can API gateway connect to alb?

Additional features provided by API GatewayThe request routing based on endpoint rules can also be supported by ALB, especially when paired with Lambda functions.

Do we need both API gateway and load balancer?

There must be a load balancer for the API gateway that can adapt to changes in microservices, such as versioning and dynamic scaling.

Should I use alb or API gateway?

Pricing. Also, as we discussed previously, ALBs rule when it comes to cost at scale. API Gateway is more affordable than ALB for up to around 500,000 monthly transactions. But at larger scales, API Gateway's costs quickly accumulate, and ALB becomes the much more affordable solution.


1 Answers

The answer marked as correct is outdated. It is now possible to integrate API Gateway with an internal facing ALB through HTTP private integration using VPC Link. See https://stackoverflow.com/a/67413951/2948212 for a step by step configuration.

like image 164
diegosasw Avatar answered Oct 17 '22 09:10

diegosasw