resource "aws_ecs_service" "my_api" { name = "my-api" task_definition = aws_ecs_task_definition.my_api.arn cluster = aws_ecs_cluster.my_cluster.id launch_type = "FARGATE" load_balancer { target_group_arn = aws_lb_target_group.my_api.arn container_name = "my-api" container_port = "3000" } desired_count = 1 network_configuration { assign_public_ip = false security_groups = [ aws_security_group.egress_all.id, aws_security_group.ingress_api.id, ] subnets = [ aws_subnet.private_a.id, aws_subnet.private_b.id ] } }