From b55b601c15627e76a85be47214fdf6b28c0adcf6 Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Thu, 12 Mar 2026 11:45:25 +0000 Subject: [PATCH 1/2] ignore infrastucture file when zipping python --- .../modules/lambda_with_api_gateway/variables.tf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/infrastructure/terraform/modules/lambda_with_api_gateway/variables.tf b/infrastructure/terraform/modules/lambda_with_api_gateway/variables.tf index 0b1dfe71..d0d2b933 100644 --- a/infrastructure/terraform/modules/lambda_with_api_gateway/variables.tf +++ b/infrastructure/terraform/modules/lambda_with_api_gateway/variables.tf @@ -6,7 +6,13 @@ variable "runtime" { type = string } variable "zip_excludes" { type = list(string) - default = ["**/__pycache__/**", "**/*.pyc", "**/.pytest_cache/**", "**/tests/**"] + default = [ + "**/__pycache__/**", + "**/*.pyc", + "**/.pytest_cache/**", + "**/tests/**", + "**/infrastructure/**" + ] } variable "timeout" { From 93915efd9d6e0f65cb624c515586c8d5af4a911b Mon Sep 17 00:00:00 2001 From: Daniel Roth Date: Thu, 12 Mar 2026 12:02:55 +0000 Subject: [PATCH 2/2] ensure pip install runs before zip by moving the install command to lambda_with_api_gateway --- .../terraform/lambda/fast-api/main.tf | 22 +------------------ .../modules/lambda_with_api_gateway/main.tf | 13 +++++++++++ .../lambda_with_api_gateway/variables.tf | 7 +++++- 3 files changed, 20 insertions(+), 22 deletions(-) diff --git a/infrastructure/terraform/lambda/fast-api/main.tf b/infrastructure/terraform/lambda/fast-api/main.tf index 9e8c7c2b..4bf88720 100644 --- a/infrastructure/terraform/lambda/fast-api/main.tf +++ b/infrastructure/terraform/lambda/fast-api/main.tf @@ -47,27 +47,6 @@ locals { # name = var.domain_name # } -############################################ -# Install Python requirements -############################################ -resource "null_resource" "pip_install" { - triggers = { - requirements_hash = filemd5("${path.root}/../../../../backend/app/requirements/requirements.txt") - } - - provisioner "local-exec" { - command = <