1

I am in the process of replacing nginx. Currently, my nginx instance routes traffic to an s3 bucket OR to apigateway (apigateway then routes traffic to different lambda functions).

Originally, I was considering replacing the nginx routing with an application load balancer, but I can't find any information on how to set up api gateway as a target group for the alb. Also for context, we want to keep our current apigateway as is.

My main questions are:

  1. Is it possible to make apigateway a target group for an alb?
  2. Is this a reasonable approach? Or would it make more sense to just move all the routing logic into apigateway? Or some other alternative?

Thanks in advance!

Sarah Ganci
  • 209
  • 1
  • 10

1 Answers1

2

Is it possible to make apigateway a target group for an alb?

NO

As per the existing documentation currently you cannot have apigateway as the target group of ALB. You can get more details here - load-balancer-target-groups.html

Is this a reasonable approach? Or would it make more sense to just move all the routing logic into apigateway? Or some other alternative?

Since Apigateway is not supported as a target group. I would recommend following approach based on the usecase

If you have a dynamic website with static and dynamic content

Backend

The backend can be served via the internal load balancer as shown in the below diagram. You can also skip the internal load balancer and directly hit the lamda function as you are currently doing. It can also be a kubernetes cluster or an EC2 instance behind the internal load balancer.

Frontend

The frontend can be served via an External Load Balancer. In you case you can send the requests directly to S3 via Cloudfront.

enter image description here

codeaprendiz
  • 2,703
  • 1
  • 25
  • 49