From a58c780469e43d6f473a8ae27e4fa61c0ec029af Mon Sep 17 00:00:00 2001 From: aloftus23 <79927030+aloftus23@users.noreply.github.com> Date: Tue, 7 Nov 2023 12:04:27 -0500 Subject: [PATCH] Add network_configuration to aws_ecs_service (pe-worker-shodan) (#2371) * Add network_configuration to aws_ecs_service * Fix subnets assignment --- backend/src/tasks/functions.yml | 2 +- infrastructure/pe_worker.tf | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/tasks/functions.yml b/backend/src/tasks/functions.yml index 8bc1a46f0..ab000f094 100644 --- a/backend/src/tasks/functions.yml +++ b/backend/src/tasks/functions.yml @@ -33,7 +33,7 @@ scanExecution: handler: src/tasks/scanExecution.handler timeout: 300 # 5 minutes environment: - SQS_QUEUE_NAME: ${self:provider.stage}-worker-queue + SQS_QUEUE_NAME: ${self:provider.stage}-worker-control-queue events: - sqs: arn: diff --git a/infrastructure/pe_worker.tf b/infrastructure/pe_worker.tf index 743ded08d..cf039c9fd 100644 --- a/infrastructure/pe_worker.tf +++ b/infrastructure/pe_worker.tf @@ -176,4 +176,8 @@ resource "aws_ecs_service" "shodan_service" { task_definition = aws_ecs_task_definition.pe_worker.arn launch_type = "FARGATE" desired_count = 0 # Initially set to 0, plan to start it dynamically + network_configuration { + subnets = aws_subnet.worker.*.id + security_groups = [aws_security_group.worker.id] + } } \ No newline at end of file