Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add AWS API gateway with application load balancer for ECS?

How to integrate API gateway with application load balancer? I have integrated ECS with ALB, now I want to add API gateway in front without lambda. But I got confused how to connect API gateway with ALB..

like image 766
Mihir Shah Avatar asked Jan 11 '19 16:01

Mihir Shah


1 Answers

What you're probably looking for is the HTTP Proxy Integration as described here

The basic idea is this:

  1. Set up your API-Gateway with a greedy path like /{proxy+} on the ANY Method
  2. Set the backend-endpoint to https://my-alb-endpoint.com/ecs-service-bla/{proxy}
  3. (hopefully) success

To make this work, your backend needs to be exposed to the internet (or at least reachable for the API Gateway)!

You probably should keep your backend within a locked down VPC, but for this you're going to need to set up a private integration, which requires a Network Load balancer - this might be costlier, but would be the recommended approach.

like image 194
Maurice Avatar answered Oct 25 '22 22:10

Maurice