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" {