AWS NLB警告:这些子网连接了Internet网关

问题描述 投票:4回答:1

我对AWS比较陌生。我已经能够:

  • 设置边缘优化的API网关端点(带有自定义域...安装SSL证书等)
  • 将请求从API网关路由到通过HTTP代理在EC2实例上运行的服务器

[为了学习,我想在API网关和EC2实例之间放置一个网络负载平衡器(NLB)。之后,我想尝试使用自动伸缩组(以了解如何伸缩EC2实例)。

BUT我被困在NLB上了。将其添加后,对API网关端点的请求仅返回internal server error

问题

我应该使用internal还是internet-facing NLB将请求从API网关路由到EC2实例?

  • [当我选择使用internal NLB时,收到警告消息You are creating an internal Load Balancer, but there is an Internet Gateway attached to these subnets ...,然后遇到internal server error问题。
  • [当我设置internet-facing NLB时,API网关警告我,“您的NLB已经面向公众,因此可能不需要使用VPC链接”。

有人可以阐明我应该做什么吗?

enter image description here

amazon-web-services amazon-ec2 aws-api-gateway elastic-load-balancer
1个回答
0
投票
我能够在专用子网中创建NLB并创建VPC链接。专用子网使用网络地址转换(NAT)网关,而不是Internet网关。链接:https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html

NLBenter image description here

VPCLink

enter image description here
© www.soinside.com 2019 - 2024. All rights reserved.