From bf4ce43b21549d5384734248d619b81af2426bf3 Mon Sep 17 00:00:00 2001 From: chrispsheehan Date: Mon, 22 Jun 2026 16:45:45 +0100 Subject: [PATCH] fix: proper bootstrap lambda --- infra/modules/aws/cost_explorer/bootstrap/index.py | 5 +++++ infra/modules/aws/cost_explorer/data.tf | 10 +++------- infra/modules/aws/log_processor/bootstrap/index.py | 5 +++++ infra/modules/aws/log_processor/data.tf | 10 +++------- 4 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 infra/modules/aws/cost_explorer/bootstrap/index.py create mode 100644 infra/modules/aws/log_processor/bootstrap/index.py diff --git a/infra/modules/aws/cost_explorer/bootstrap/index.py b/infra/modules/aws/cost_explorer/bootstrap/index.py new file mode 100644 index 0000000..8634b16 --- /dev/null +++ b/infra/modules/aws/cost_explorer/bootstrap/index.py @@ -0,0 +1,5 @@ +def handler(event, context): + return { + "statusCode": 200, + "body": "bootstrap lambda", + } diff --git a/infra/modules/aws/cost_explorer/data.tf b/infra/modules/aws/cost_explorer/data.tf index 45add9d..a062658 100644 --- a/infra/modules/aws/cost_explorer/data.tf +++ b/infra/modules/aws/cost_explorer/data.tf @@ -1,11 +1,7 @@ data "archive_file" "bootstrap_lambda" { - type = "zip" - source_content = <<-PY -def lambda_handler(event, context): - return {"statusCode": 200, "body": "bootstrap"} -PY - source_content_filename = "index.py" - output_path = "${path.module}/bootstrap-lambda.zip" + type = "zip" + source_file = "${path.module}/bootstrap/index.py" + output_path = "${path.module}/${local.lambda_bootstrap_zip_key}" } data "aws_iam_policy_document" "assume_role" { diff --git a/infra/modules/aws/log_processor/bootstrap/index.py b/infra/modules/aws/log_processor/bootstrap/index.py new file mode 100644 index 0000000..8634b16 --- /dev/null +++ b/infra/modules/aws/log_processor/bootstrap/index.py @@ -0,0 +1,5 @@ +def handler(event, context): + return { + "statusCode": 200, + "body": "bootstrap lambda", + } diff --git a/infra/modules/aws/log_processor/data.tf b/infra/modules/aws/log_processor/data.tf index c50a95e..20c82ea 100644 --- a/infra/modules/aws/log_processor/data.tf +++ b/infra/modules/aws/log_processor/data.tf @@ -1,11 +1,7 @@ data "archive_file" "bootstrap_lambda" { - type = "zip" - source_content = <<-PY -def lambda_handler(event, context): - return {"statusCode": 200, "body": "bootstrap"} -PY - source_content_filename = "index.py" - output_path = "${path.module}/bootstrap-lambda.zip" + type = "zip" + source_file = "${path.module}/bootstrap/index.py" + output_path = "${path.module}/${local.lambda_bootstrap_zip_key}" } data "aws_iam_policy_document" "assume_role" {