Open atticus-trellix opened 1 year ago
The code in the video has the following for the VPC module : enable_nat_gateway = true
. To understand the error you need to understand why we would want a NAT gateway.
NAT gateways are used when you want EC2 instances in a private subnet to be able to connect to the internet for things like Linux package updates, but you do not want devices outside the private subnet to be able to connect to the instances (like with ssh). The NAT gateway is on a public subnet in your VPC, and an entry for the IP of that NAT gateway is added to the route table of the private subnet.
The Problem :: The configuration in the video asks for a NAT gateway, but there aren't any private subnets with a route table to update with the IP of that NAT gateway. The error is saying that you have an empty list of private subnets. Put another way, the configuration is incomplete.
You can fix the error by removing the enable_nat_gateway = true
setting.
When running the code solution in branch 04_01, terraform returns errors: