Skip to content

Instantly share code, notes, and snippets.

@pmatsinopoulos
Created August 28, 2023 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmatsinopoulos/3d2180201cc33b79c55842097126d8f4 to your computer and use it in GitHub Desktop.
Save pmatsinopoulos/3d2180201cc33b79c55842097126d8f4 to your computer and use it in GitHub Desktop.
AWS Public and Private Subnets - route_table_to_nat_gateway.tf
resource "aws_route_table" "to_nat_gateway" {
vpc_id = aws_vpc.private_and_public_subnets.id
tags = {
"Name" = "access-to-nat-gateway"
}
}
resource "aws_route" "to_nat_gateway" {
route_table_id = aws_route_table.to_nat_gateway.id
destination_cidr_block = "0.0.0.0/0"
nat_gateway_id = aws_nat_gateway.private_and_public_subnets.id
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment