diff --git a/terraform/main.tf b/terraform/main.tf index 32edf44..a08c445 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -52,11 +52,17 @@ resource "aws_ecs_service" "mood_marker_api_service" { launch_type = "FARGATE" network_configuration { - subnets = [aws_subnet.mood_marker_api_subnet_1.id] + subnets = [aws_subnet.mood_marker_api_subnet_1.id, aws_subnet.mood_marker_api_subnet_2.id] assign_public_ip = true security_groups = [aws_security_group.mood_marker_api_sg.id] } + load_balancer { + target_group_arn = aws_lb_target_group.mood_maker_api_target_group.arn + container_name = "mood-marker-api" + container_port = 80 + } + depends_on = [ aws_ecs_cluster.mood_marker_api_cluster, aws_ecs_task_definition.mood_marker_api_task