是否可以为没有弹性 IP 的 EC2 实例创建只有 public 子网和 NAT 的 VPC?

Is it possible to create a VPC with only a public subnet and NAT for EC2 instances without elastic IPs?

我需要将一大群虚拟机迁移到 AWS。其中一些有 Public 个 IP,其他只有本地 IP。是否可以在 VPC 中创建 Public 和私有 IP 的混合子网,以便具有 Public IP 的实例通过弹性 IP 和互联网网关访问互联网,而没有实例a Public IP 通过 NAT 上网。本地 IP 实例必须位于单个子网中,例如 192.168.1.0/24。

请问有什么办法吗?什么是最佳方法?

By definition,public 子网有一个到 Internet 网关的路由。该子网中任何需要访问互联网的东西都需要分配一个 public IP(不一定是弹性 IP,只是一个 public IP)。

If a subnet's traffic is routed to an internet gateway, the subnet is known as a public subnet.

同样,根据定义,私有子网是没有 Internet 网关的子网,它依赖到 NAT 网关的路由来访问 Internet。

If a subnet doesn't have a route to the internet gateway, the subnet is known as a private subnet.

根据您的问题,不,没有办法根据是否存在 public IP 将流量路由到互联网网关和 NAT 网关的单一路由 table源服务器上的地址。