Skip to content

Commit

Permalink
removed access to internet
Browse files Browse the repository at this point in the history
  • Loading branch information
kunduso committed Oct 14, 2023
1 parent ed8e049 commit 31e423b
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions network.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,35 +53,4 @@ resource "aws_route_table_association" "public" {
count = length(var.subnet_cidr_public)
subnet_id = element(aws_subnet.public.*.id, count.index)
route_table_id = aws_route_table.public.id
}
resource "aws_internet_gateway" "this-igw" {
vpc_id = aws_vpc.this.id
tags = {
"Name" = "app-4-gateway"
}
}
resource "aws_route" "internet-route" {
destination_cidr_block = "0.0.0.0/0"
route_table_id = aws_route_table.public.id
gateway_id = aws_internet_gateway.this-igw.id
}
resource "aws_eip" "nat_gateway" {
count = length(var.subnet_cidr_public)
domain = "vpc"
#checkov:skip=CKV2_AWS_19: The IP is attached to the NAT gateway
}
resource "aws_nat_gateway" "public" {
count = length(var.subnet_cidr_public)
subnet_id = element(aws_subnet.public.*.id, count.index)
allocation_id = aws_eip.nat_gateway[count.index].id
depends_on = [aws_internet_gateway.this-igw]
tags = {
"Name" = "app-4-NAT-${count.index + 1}"
}
}
resource "aws_route" "private-route" {
count = length(var.subnet_cidr_private)
destination_cidr_block = "0.0.0.0/0"
route_table_id = aws_route_table.private[count.index].id
nat_gateway_id = aws_nat_gateway.public[0].id
}

0 comments on commit 31e423b

Please sign in to comment.