diff --git a/infra/load-balancer.tf b/infra/load-balancer.tf index f0b92b0..b8acc59 100644 --- a/infra/load-balancer.tf +++ b/infra/load-balancer.tf @@ -9,7 +9,10 @@ resource "aws_lb" "alpha" { internal = false load_balancer_type = "application" subnets = [ aws_subnet.delphi.id, aws_subnet.crete_subnet.id ] - security_groups = [ aws_security_group.ecs_web_ingress.id ] + security_groups = [ + aws_security_group.ecs_web_ingress.id, + aws_security_group.load_balancer_health_check.id + ] # TODO: change this to true later enable_deletion_protection = false } diff --git a/infra/route-table.tf b/infra/route-table.tf index 36f65ad..8901a67 100644 --- a/infra/route-table.tf +++ b/infra/route-table.tf @@ -10,7 +10,14 @@ resource "aws_route_table" "crete_route_table" { Name = "Crete IGW Route Table" } } + + resource "aws_route_table_association" "crete_gateway_association" { subnet_id = aws_subnet.crete_subnet.id route_table_id = aws_route_table.crete_route_table.id } + +resource "aws_route_table_association" "delphi_gateway_association" { + subnet_id = aws_subnet.delphi.id + route_table_id = aws_route_table.crete_route_table.id +} diff --git a/infra/security-groups.tf b/infra/security-groups.tf index 6f88905..41dd63c 100644 --- a/infra/security-groups.tf +++ b/infra/security-groups.tf @@ -40,6 +40,17 @@ resource "aws_security_group" "base_ecs" { } } +resource "aws_security_group" "load_balancer_health_check" { + name = "Load Balancer Health check" + vpc_id = aws_vpc.athens_vpc.id + egress { + cidr_blocks = ["10.0.0.0/8"] + from_port = 80 + to_port = 80 + protocol = "tcp" + } +} + resource "aws_security_group" "general_web_req" { name = "Athens General web server ruleset" description = "Allowing strictly web traffic"