Skip to content

Commit

Permalink
Added rt, route and rt assoc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronaldo Macapobre committed Aug 7, 2024
1 parent 26add7b commit b2ed914
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions infrastructure/cloud/modules/networking/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,18 @@ resource "aws_internet_gateway" "igw" {
}
}

# resource "aws_default_route_table" "rt_public" {
# default_route_table_id = data.aws_vpc.vpc.default_route_table_id
resource "aws_route_table" "rt" {
vpc_id = data.aws_vpc.vpc.id
}

# route {
# cidr_block = "0.0.0.0/0"
# gateway_id = aws_internet_gateway.igw.id
# }
resource "aws_route" "route" {
route_table_id = aws_route_table.rt.id
destination_cidr_block = "0.0.0.0/0"
gateway_id = aws_internet_gateway.igw.id
}

# tags = {
# Name = "${var.app_name}_public_rt_${var.environment}"
# }
# }
resource "aws_route_table_association" "rt_assoc" {
count = length(var.web_subnet_names)
subnet_id = local.web_subnets[count.index]
route_table_id = aws_route_table.rt.id
}

0 comments on commit b2ed914

Please sign in to comment.