Skip to content

Commit

Permalink
Attach the service to the load balancer
Browse files Browse the repository at this point in the history
  • Loading branch information
kmesiab committed Mar 6, 2024
1 parent 2183d98 commit 97276fa
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 97276fa

Please sign in to comment.