Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS NLB warning: There is an Internet Gateway attached to these subnets

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

like image 451
Dan Avatar asked Mar 21 '18 18:03

Dan


1 Answers

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

like image 83
Harsha Jayamanna Avatar answered Sep 28 '22 11:09

Harsha Jayamanna