@@ -138,84 +138,84 @@ resource "aws_ecs_cluster" "main" {
138138 }
139139}
140140
141- # Application Load Balancer
142- resource "aws_security_group" "alb" {
143- name = " ${ var . project_name } -alb-sg"
144- description = " Security group for Application Load Balancer"
145- vpc_id = aws_vpc. main . id
146-
147- ingress {
148- from_port = 80
149- to_port = 80
150- protocol = " tcp"
151- cidr_blocks = [" 0.0.0.0/0" ]
152- }
153-
154- ingress {
155- from_port = 443
156- to_port = 443
157- protocol = " tcp"
158- cidr_blocks = [" 0.0.0.0/0" ]
159- }
160-
161- egress {
162- from_port = 0
163- to_port = 0
164- protocol = " -1"
165- cidr_blocks = [" 0.0.0.0/0" ]
166- }
167-
168- tags = {
169- Name = " ${ var . project_name } -alb-sg"
170- }
171- }
172-
173- resource "aws_lb" "main" {
174- name = " ${ var . project_name } -alb"
175- internal = false
176- load_balancer_type = " application"
177- security_groups = [aws_security_group . alb . id ]
178- subnets = aws_subnet. public [* ]. id
179-
180- tags = {
181- Name = " ${ var . project_name } -alb"
182- }
183- }
184-
185- resource "aws_lb_target_group" "api" {
186- name = " ${ var . project_name } -api-tg"
187- port = 8000
188- protocol = " HTTP"
189- vpc_id = aws_vpc. main . id
190- target_type = " ip"
191-
192- health_check {
193- enabled = true
194- healthy_threshold = 2
195- interval = 30
196- matcher = " 200"
197- path = " /health"
198- port = " traffic-port"
199- protocol = " HTTP"
200- timeout = 5
201- unhealthy_threshold = 2
202- }
203-
204- tags = {
205- Name = " ${ var . project_name } -api-tg"
206- }
207- }
208-
209- resource "aws_lb_listener" "api" {
210- load_balancer_arn = aws_lb. main . arn
211- port = " 80"
212- protocol = " HTTP"
213-
214- default_action {
215- type = " forward"
216- target_group_arn = aws_lb_target_group. api . arn
217- }
218- }
141+ # Application Load Balancer (COMMENTED OUT - Re-enable when AWS Support approves ALB access)
142+ # resource "aws_security_group" "alb" {
143+ # name = "${var.project_name}-alb-sg"
144+ # description = "Security group for Application Load Balancer"
145+ # vpc_id = aws_vpc.main.id
146+ #
147+ # ingress {
148+ # from_port = 80
149+ # to_port = 80
150+ # protocol = "tcp"
151+ # cidr_blocks = ["0.0.0.0/0"]
152+ # }
153+ #
154+ # ingress {
155+ # from_port = 443
156+ # to_port = 443
157+ # protocol = "tcp"
158+ # cidr_blocks = ["0.0.0.0/0"]
159+ # }
160+ #
161+ # egress {
162+ # from_port = 0
163+ # to_port = 0
164+ # protocol = "-1"
165+ # cidr_blocks = ["0.0.0.0/0"]
166+ # }
167+ #
168+ # tags = {
169+ # Name = "${var.project_name}-alb-sg"
170+ # }
171+ # }
172+ #
173+ # resource "aws_lb" "main" {
174+ # name = "${var.project_name}-alb"
175+ # internal = false
176+ # load_balancer_type = "application"
177+ # security_groups = [aws_security_group.alb.id]
178+ # subnets = aws_subnet.public[*].id
179+ #
180+ # tags = {
181+ # Name = "${var.project_name}-alb"
182+ # }
183+ # }
184+ #
185+ # resource "aws_lb_target_group" "api" {
186+ # name = "${var.project_name}-api-tg"
187+ # port = 8000
188+ # protocol = "HTTP"
189+ # vpc_id = aws_vpc.main.id
190+ # target_type = "ip"
191+ #
192+ # health_check {
193+ # enabled = true
194+ # healthy_threshold = 2
195+ # interval = 30
196+ # matcher = "200"
197+ # path = "/health"
198+ # port = "traffic-port"
199+ # protocol = "HTTP"
200+ # timeout = 5
201+ # unhealthy_threshold = 2
202+ # }
203+ #
204+ # tags = {
205+ # Name = "${var.project_name}-api-tg"
206+ # }
207+ # }
208+ #
209+ # resource "aws_lb_listener" "api" {
210+ # load_balancer_arn = aws_lb.main.arn
211+ # port = "80"
212+ # protocol = "HTTP"
213+ #
214+ # default_action {
215+ # type = "forward"
216+ # target_group_arn = aws_lb_target_group.api.arn
217+ # }
218+ # }
219219
220220# Security group for ECS tasks
221221resource "aws_security_group" "ecs" {
@@ -224,10 +224,10 @@ resource "aws_security_group" "ecs" {
224224 vpc_id = aws_vpc. main . id
225225
226226 ingress {
227- from_port = 8000
228- to_port = 8000
229- protocol = " tcp"
230- security_groups = [aws_security_group . alb . id ]
227+ from_port = 8000
228+ to_port = 8000
229+ protocol = " tcp"
230+ cidr_blocks = [" 0.0.0.0/0 " ] # Allow direct access from internet (temporary until ALB is enabled)
231231 }
232232
233233 egress {
@@ -456,13 +456,14 @@ resource "aws_ecs_service" "api" {
456456 assign_public_ip = true
457457 }
458458
459- load_balancer {
460- target_group_arn = aws_lb_target_group. api . arn
461- container_name = " api"
462- container_port = 8000
463- }
464-
465- depends_on = [aws_lb_listener . api ]
459+ # Load balancer configuration commented out until ALB access is enabled
460+ # load_balancer {
461+ # target_group_arn = aws_lb_target_group.api.arn
462+ # container_name = "api"
463+ # container_port = 8000
464+ # }
465+ #
466+ # depends_on = [aws_lb_listener.api]
466467
467468 tags = {
468469 Name = " ${ var . project_name } -api-service"
0 commit comments