Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion terraform/aws/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ resource "aws_ecs_service" "backend" {
security_groups = [aws_security_group.ecs_tasks_sg.id]
assign_public_ip = true
}

load_balancer {
target_group_arn = aws_lb_target_group.backend.arn
container_name = "backend"
container_port = 8000
}

depends_on = [aws_lb_listener.http]
}

resource "aws_ecs_task_definition" "frontend" {
Expand All @@ -63,7 +71,7 @@ resource "aws_ecs_task_definition" "frontend" {
environment = [
{
name = "NEXT_PUBLIC_API_URL"
value = "http://localhost:8000/api" # Placeholder since no ALB
value = "http://${aws_lb.main.dns_name}"
}
]
portMappings = [
Expand Down Expand Up @@ -96,6 +104,14 @@ resource "aws_ecs_service" "frontend" {
security_groups = [aws_security_group.ecs_tasks_sg.id]
assign_public_ip = true
}

load_balancer {
target_group_arn = aws_lb_target_group.frontend.arn
container_name = "frontend"
container_port = 3000
}

depends_on = [aws_lb_listener.http]
}

resource "aws_cloudwatch_log_group" "backend" {
Expand Down
Loading