From bbdb760bdb0382a1bc2474389f2baab4114e576f Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Thu, 5 Mar 2026 16:32:52 +0000 Subject: [PATCH 1/5] increase lambda timeout to 2mins --- infrastructure/terraform/lambda/categorisation/main.tf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/infrastructure/terraform/lambda/categorisation/main.tf b/infrastructure/terraform/lambda/categorisation/main.tf index cfa2e0e1..b7193da4 100644 --- a/infrastructure/terraform/lambda/categorisation/main.tf +++ b/infrastructure/terraform/lambda/categorisation/main.tf @@ -24,6 +24,8 @@ module "lambda" { maximum_concurrency = var.maximum_concurrency batch_size = var.batch_size + timeout = 120 + environment = merge( { STAGE = var.stage From 2312b658192f3386667b4ca5e3b3acce44de49dc Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 5 Mar 2026 16:35:42 +0000 Subject: [PATCH 2/5] added sns topic for ses debugging: --- infrastructure/terraform/modules/ses/main.tf | 37 +++++++++++++++++-- .../terraform/modules/ses/variables.tf | 1 + sfr/principal_pitch/2_export_data.py | 8 ++-- 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/infrastructure/terraform/modules/ses/main.tf b/infrastructure/terraform/modules/ses/main.tf index e8f183ae..cb7f9087 100644 --- a/infrastructure/terraform/modules/ses/main.tf +++ b/infrastructure/terraform/modules/ses/main.tf @@ -12,6 +12,35 @@ resource "aws_iam_user" "ses_user" { name = "${var.stage}-ses-user" } +# SES configuration set for tracking events +resource "aws_ses_configuration_set" "this" { + name = "${var.stage}-ses-config" +} + +# SNS topic for SES event notifications +resource "aws_sns_topic" "ses_events" { + name = "${var.stage}-ses-events" +} + +# SES event destination for debugging +resource "aws_ses_event_destination" "sns" { + name = "ses-event-destination" + configuration_set_name = aws_ses_configuration_set.this.name + enabled = true + + matching_types = [ + "send", + "bounce", + "reject", + "complaint", + "delivery" + ] + + sns_destination { + topic_arn = aws_sns_topic.ses_events.arn + } +} + resource "aws_iam_user_policy" "ses_send_policy" { name = "AllowSESSendEmail" user = aws_iam_user.ses_user.name @@ -20,8 +49,8 @@ resource "aws_iam_user_policy" "ses_send_policy" { Version = "2012-10-17" Statement = [ { - Effect = "Allow" - Action = [ + Effect = "Allow" + Action = [ "ses:SendEmail", "ses:SendRawEmail" ] @@ -42,9 +71,9 @@ resource "aws_secretsmanager_secret" "ses_smtp" { } resource "aws_secretsmanager_secret_version" "ses_smtp" { - secret_id = aws_secretsmanager_secret.ses_smtp.id + secret_id = aws_secretsmanager_secret.ses_smtp.id secret_string = jsonencode({ username = aws_iam_access_key.ses_user.id password = aws_iam_access_key.ses_user.ses_smtp_password_v4 }) -} \ No newline at end of file +} diff --git a/infrastructure/terraform/modules/ses/variables.tf b/infrastructure/terraform/modules/ses/variables.tf index d8c97d6d..26d63b82 100644 --- a/infrastructure/terraform/modules/ses/variables.tf +++ b/infrastructure/terraform/modules/ses/variables.tf @@ -7,3 +7,4 @@ variable "stage" { description = "Deployment stage (e.g. dev, prod)" type = string } + diff --git a/sfr/principal_pitch/2_export_data.py b/sfr/principal_pitch/2_export_data.py index 374ed16d..b6a33ae1 100644 --- a/sfr/principal_pitch/2_export_data.py +++ b/sfr/principal_pitch/2_export_data.py @@ -28,15 +28,15 @@ from sqlalchemy import func # PORTFOLIO_ID = 206 # SCENARIOS = [389] -PORTFOLIO_ID = 597 +PORTFOLIO_ID = 581 SCENARIOS = [ - 1099 + 1124 ] scenario_names = { - 1099: "£10k cost capped - no solid wall or floor", + 1124: "EPC C - Solar Focused", } -project_name = "Livespace Rentals" +project_name = "WCHG EPC D rated properties" def get_data(portfolio_id, scenario_ids): From ca6ee9c3c67d0e2c230a3a040d9d4471b383217b Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 6 Mar 2026 10:58:20 +0000 Subject: [PATCH 3/5] empty commit --- backend/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/README.md b/backend/README.md index b8e859c2..9671b7b3 100644 --- a/backend/README.md +++ b/backend/README.md @@ -364,5 +364,5 @@ Here's what you should do: function. By following these steps, you should have your custom domain properly configured and pointing to your AWS Lambda -function via the CloudFront distribution. +function via the CloudFront distribution From 840ce73111e293607e29742a14a2d734847fdbd2 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 6 Mar 2026 11:16:11 +0000 Subject: [PATCH 4/5] set batch_size to 1 for engine tf deployment --- infrastructure/terraform/lambda/engine/main.tf | 2 +- infrastructure/terraform/lambda/engine/variables.tf | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/infrastructure/terraform/lambda/engine/main.tf b/infrastructure/terraform/lambda/engine/main.tf index 9d44c9ed..24c0d8d9 100644 --- a/infrastructure/terraform/lambda/engine/main.tf +++ b/infrastructure/terraform/lambda/engine/main.tf @@ -24,8 +24,8 @@ module "lambda" { image_uri = local.image_uri - # Optional: Set maximum_concurrency to limit concurrent SQS-triggered invocations (2-1000) maximum_concurrency = var.maximum_concurrency + batch_size = var.batch_size environment = merge( { diff --git a/infrastructure/terraform/lambda/engine/variables.tf b/infrastructure/terraform/lambda/engine/variables.tf index 9805d409..592da24c 100644 --- a/infrastructure/terraform/lambda/engine/variables.tf +++ b/infrastructure/terraform/lambda/engine/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 +} + variable "db_host" { type = string sensitive = true From a2db212dcece456d3de56170890fb91c423a06c4 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Fri, 6 Mar 2026 11:28:35 +0000 Subject: [PATCH 5/5] also set timeout and memory_size --- infrastructure/terraform/lambda/engine/main.tf | 2 ++ infrastructure/terraform/lambda/engine/variables.tf | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/infrastructure/terraform/lambda/engine/main.tf b/infrastructure/terraform/lambda/engine/main.tf index 24c0d8d9..35c00fa3 100644 --- a/infrastructure/terraform/lambda/engine/main.tf +++ b/infrastructure/terraform/lambda/engine/main.tf @@ -26,6 +26,8 @@ module "lambda" { maximum_concurrency = var.maximum_concurrency batch_size = var.batch_size + timeout = var.timeout + memory_size = var.memory_size environment = merge( { diff --git a/infrastructure/terraform/lambda/engine/variables.tf b/infrastructure/terraform/lambda/engine/variables.tf index 592da24c..0a74ad5b 100644 --- a/infrastructure/terraform/lambda/engine/variables.tf +++ b/infrastructure/terraform/lambda/engine/variables.tf @@ -28,6 +28,18 @@ variable "batch_size" { default = 1 } +variable "timeout" { + type = number + default = 900 + description = "Lambda timeout in seconds" +} + +variable "memory_size" { + type = number + default = 3008 + description = "Lambda memory size in MB" +} + variable "db_host" { type = string sensitive = true