Create a file called and use it to create routes for both public and private subnets, create the below resources. Ensure they are properly tagged.

  • aws_route_table
  • aws_route
  • aws_route_table_association
# create private route table
resource "aws_route_table" "private-rtb" {
  vpc_id =

  tags = merge(
      Name = format("%s-Private-Route-Table",

# associate all private subnets to the private route table
resource "aws_...
Learn More