From 555f41412d25d21b97a83eda83e3c51c491bbcdf Mon Sep 17 00:00:00 2001 From: TomJKing Date: Thu, 2 Jan 2025 09:50:28 +0000 Subject: [PATCH 1/2] Add rate limiting environment variables --- root_transfer_service.tf | 2 ++ templates/ecs_tasks/transfer_service.json.tpl | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/root_transfer_service.tf b/root_transfer_service.tf index a29b842..b87363e 100644 --- a/root_transfer_service.tf +++ b/root_transfer_service.tf @@ -152,6 +152,8 @@ module "transfer_service_ecs_task" { max_individual_file_size_mb = 2000 max_transfer_size_mb = 5000 transfer_service_client_secret_path = local.keycloak_tdr_transfer_service_secret_name + throttle_amount = 50 + throttle_per_ms = 10 }) container_name = "transfer-service" cpu = 512 diff --git a/templates/ecs_tasks/transfer_service.json.tpl b/templates/ecs_tasks/transfer_service.json.tpl index c9917de..139e8e6 100644 --- a/templates/ecs_tasks/transfer_service.json.tpl +++ b/templates/ecs_tasks/transfer_service.json.tpl @@ -53,7 +53,15 @@ { "name": "MAX_TRANSFER_SIZE_MB", "value": "${max_transfer_size_mb}" - } + }, + { + "name": "THROTTLE_AMOUNT", + "value": "${throttle_amount}" + }, + { + "name": "THROTTLE_PER_MS", + "value": "${throttle_per_ms}" + } ], "logConfiguration": { "logDriver": "awslogs", From e760221431eb67045112ad0e655057dbc56a7f5b Mon Sep 17 00:00:00 2001 From: TomJKing Date: Wed, 8 Jan 2025 07:53:09 +0000 Subject: [PATCH 2/2] Fix environment variable --- templates/ecs_tasks/transfer_service.json.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/ecs_tasks/transfer_service.json.tpl b/templates/ecs_tasks/transfer_service.json.tpl index 139e8e6..9c5939c 100644 --- a/templates/ecs_tasks/transfer_service.json.tpl +++ b/templates/ecs_tasks/transfer_service.json.tpl @@ -43,7 +43,7 @@ "value": "${transfer_service_api_port}" }, { - "name": " MAX_NUMBER_RECORDS", + "name": "MAX_NUMBER_RECORDS", "value": "${max_number_records}" }, {