From dbf5bf41226be61285cc56b6cd80a803b432a852 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 4 Mar 2026 12:35:18 +0000 Subject: [PATCH 1/3] set concurrency and batch size on categorisation lambda --- .github/workflows/deploy_terraform.yml | 1 + infrastructure/terraform/lambda/categorisation/main.tf | 4 ++-- infrastructure/terraform/lambda/categorisation/variables.tf | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy_terraform.yml b/.github/workflows/deploy_terraform.yml index 4c9ce44a..8c768965 100644 --- a/.github/workflows/deploy_terraform.yml +++ b/.github/workflows/deploy_terraform.yml @@ -193,6 +193,7 @@ jobs: lambda_name: condition-etl lambda_path: infrastructure/terraform/lambda/condition-etl stage: ${{ needs.determine_stage.outputs.stage }} + batch_size: 2 ecr_repo: condition-etl-${{ needs.determine_stage.outputs.stage }} image_digest: ${{ needs.condition_etl_image.outputs.image_digest }} terraform_apply: ${{ needs.determine_stage.outputs.terraform_apply }} diff --git a/infrastructure/terraform/lambda/categorisation/main.tf b/infrastructure/terraform/lambda/categorisation/main.tf index 6e30dd8e..cfa2e0e1 100644 --- a/infrastructure/terraform/lambda/categorisation/main.tf +++ b/infrastructure/terraform/lambda/categorisation/main.tf @@ -20,9 +20,9 @@ module "lambda" { name = "categorisation" stage = var.stage - image_uri = local.image_uri - + maximum_concurrency = var.maximum_concurrency + batch_size = var.batch_size environment = merge( { diff --git a/infrastructure/terraform/lambda/categorisation/variables.tf b/infrastructure/terraform/lambda/categorisation/variables.tf index 347964de..e3f16b34 100644 --- a/infrastructure/terraform/lambda/categorisation/variables.tf +++ b/infrastructure/terraform/lambda/categorisation/variables.tf @@ -23,6 +23,7 @@ variable "maximum_concurrency" { description = "Maximum number of concurrent Lambda invocations from SQS (2-1000). null = no limit." } + locals { image_uri = "${var.ecr_repo_url}@${var.image_digest}" } From efa510c4d48761179442ab44c047b30ea168fcc3 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 4 Mar 2026 12:36:07 +0000 Subject: [PATCH 2/3] revert random line addition --- infrastructure/terraform/lambda/categorisation/variables.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/infrastructure/terraform/lambda/categorisation/variables.tf b/infrastructure/terraform/lambda/categorisation/variables.tf index e3f16b34..347964de 100644 --- a/infrastructure/terraform/lambda/categorisation/variables.tf +++ b/infrastructure/terraform/lambda/categorisation/variables.tf @@ -23,7 +23,6 @@ variable "maximum_concurrency" { description = "Maximum number of concurrent Lambda invocations from SQS (2-1000). null = no limit." } - locals { image_uri = "${var.ecr_repo_url}@${var.image_digest}" } From 015e2863dc6917b8ad234dd32e11562159a98f67 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Wed, 4 Mar 2026 14:47:25 +0000 Subject: [PATCH 3/3] address JTK PR comments --- .github/workflows/deploy_terraform.yml | 1 - infrastructure/terraform/lambda/_template/main.tf | 2 ++ infrastructure/terraform/lambda/_template/variables.tf | 5 +++++ infrastructure/terraform/lambda/categorisation/variables.tf | 5 +++++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy_terraform.yml b/.github/workflows/deploy_terraform.yml index 8c768965..4c9ce44a 100644 --- a/.github/workflows/deploy_terraform.yml +++ b/.github/workflows/deploy_terraform.yml @@ -193,7 +193,6 @@ jobs: lambda_name: condition-etl lambda_path: infrastructure/terraform/lambda/condition-etl stage: ${{ needs.determine_stage.outputs.stage }} - batch_size: 2 ecr_repo: condition-etl-${{ needs.determine_stage.outputs.stage }} image_digest: ${{ needs.condition_etl_image.outputs.image_digest }} terraform_apply: ${{ needs.determine_stage.outputs.terraform_apply }} diff --git a/infrastructure/terraform/lambda/_template/main.tf b/infrastructure/terraform/lambda/_template/main.tf index 89e6c4c1..c6015ea1 100644 --- a/infrastructure/terraform/lambda/_template/main.tf +++ b/infrastructure/terraform/lambda/_template/main.tf @@ -36,6 +36,8 @@ module "lambda" { # Optional: Set maximum_concurrency to limit concurrent SQS-triggered invocations (2-1000) maximum_concurrency = var.maximum_concurrency + batch_size = var.batch_size + environment = { STAGE = var.stage LOG_LEVEL = "info" diff --git a/infrastructure/terraform/lambda/_template/variables.tf b/infrastructure/terraform/lambda/_template/variables.tf index e0061321..e7646811 100644 --- a/infrastructure/terraform/lambda/_template/variables.tf +++ b/infrastructure/terraform/lambda/_template/variables.tf @@ -23,6 +23,11 @@ variable "maximum_concurrency" { description = "Maximum number of concurrent Lambda invocations from SQS (2-1000). null = no limit." } +variable "batch_size" { + type = number + default = 1 +} + locals { image_uri = "${var.ecr_repo_url}@${var.image_digest}" } diff --git a/infrastructure/terraform/lambda/categorisation/variables.tf b/infrastructure/terraform/lambda/categorisation/variables.tf index 347964de..23a78875 100644 --- a/infrastructure/terraform/lambda/categorisation/variables.tf +++ b/infrastructure/terraform/lambda/categorisation/variables.tf @@ -23,6 +23,11 @@ variable "maximum_concurrency" { description = "Maximum number of concurrent Lambda invocations from SQS (2-1000). null = no limit." } +variable "batch_size" { + type = number + default = 2 +} + locals { image_uri = "${var.ecr_repo_url}@${var.image_digest}" }