(aws-ec2): Why are NAT gateways required for private subnets?
See original GitHub issue❓ General Issue
The Question
I’m very curious why this check is in place: https://github.com/aws/aws-cdk/blob/283ed02c64f827161edba3e11c3cead3b54b7ee9/packages/%40aws-cdk/aws-ec2/lib/vpc.ts#L2036-L2039
NAT gateways are, if I’m not mistaken, only required if resources within your private subnets need to access the Internet through an Internet gateway. In this case, I’m unable to use CDK to create a ServerlessCluster
, because the SubnetGroup
can’t be defined without giving it a VPC with private subnets, which strangely require NAT Gateways. If I try to create a SubnetGroup
using a VPC with public & isolated subnets, it complains and says I need to use private subnets: Error: There are no 'Private' subnet groups in this VPC. Available types: Isolated,Public
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Set up NAT gateway for private subnet in Amazon VPC
A network address translation (NAT) gateway allows EC2 instances to establish outbound connections to resources on internet without allowing ...
Read more >Create a VPC in AWS with Public and Private Subnets & ...
The purpose of this lab is to demonstrate how create a custom VPC with public subnet and an Internet gateway that will access...
Read more >AWS Quick Tips: Internet Gateways, NAT ...
While the NAT Gateway is needed for private subnets to have ... for when using an EC2 instance to perform NAT Gateway-like functionality....
Read more >AWS: NAT Gateway in public subnet. Why? - Server Fault
Usually, the default route for a private subnet points to a NAT device, ... to a NAT-gateway, so you can consider NAT-gateway as...
Read more >NAT Gateway and private subnets routing
The private subnets in your VPC should have access to Internet only through an AWS feature called NAT Gateway. The NAT Gateway configuration...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ffxsam:
It’s a fair criticism that our concept of
ISOLATED
may cause unintentional confusion. I’ve submitted a PR to renamePRIVATE
andISOLATED
toPRIVATE_WITH_NAT
andPRIVATE_ISOLATED
to hopefully make this clearer.Case in point: