8

I am relatively new to AWS. I've been able to:

  • Setup edge-optimized API Gateway endpoints (w/a custom domain ... install an SSL cert, etc.)
  • Route requests from API Gateway to a server running on an EC2 instance via HTTP proxy

For learning, I'd like to put a Network Load Balancer (NLB) between API Gateway and the EC2 instance. After that, I want to experiment with Auto-Scaling Groups (in order to see how EC2 instances can be scaled out/in).

BUT I'm stuck on the NLB. After adding it in, requests made to API Gateway endpoints simply return internal server error.

Question

Should I be using an internal or internet-facing NLB to route the requests from API Gateway to the EC2 instances?

  • When I opt to use an internal NLB, I get a warning message You are creating an internal Load Balancer, but there is an Internet Gateway attached to these subnets ... and then I run into the internal server error problem.
  • When I setup an internet-facing NLB, API Gateway warns me something to the effect of, "Your NLB is already public-facing, so the use of a VPC Link might be unnecessary".

Can someone shed some light on what I should be doing?

enter image description here

Dan
  • 4,197
  • 6
  • 34
  • 52
  • Did you ever figure this out? Also what is the purpose of both the API Gateway and ELB? CloudFront can talk directly to the ELB right? – thomas Jul 18 '18 at 15:02

1 Answers1

1

I was able to create a NLB in a private subnet and create a VPC link. Private Subnets use network address translation (NAT) gateways, not internet gatways. Link: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html

NLB enter image description here

VPCLink enter image description here

Harsha Jayamanna
  • 2,148
  • 6
  • 25
  • 43