Skip to content

Commit 9617437

Browse files
committed
fix(λ): Correctly reference zipped code
1 parent fa3bea1 commit 9617437

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

main.tf

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,11 @@ data "archive_file" "code" {
240240
}
241241

242242
resource "aws_lambda_function" "sechub_summariser" {
243-
filename = "${path.module}/sec-hub-email.zip"
244-
function_name = var.name
245-
role = aws_iam_role.iam_for_lambda.arn
246-
handler = "sec-hub-email.lambda_handler"
247-
248-
# The filebase64sha256() function is available in Terraform 0.11.12 and later
249-
# For Terraform 0.11.11 and earlier, use the base64sha256() function and the file() function:
250-
# source_code_hash = "${base64sha256(file("lambda_function_payload.zip"))}"
251-
source_code_hash = archive_file.code.output_base64sha256
243+
filename = data.archive_file.code.output_path
244+
function_name = var.name
245+
role = aws_iam_role.iam_for_lambda.arn
246+
handler = "sec-hub-email.lambda_handler"
247+
source_code_hash = data.archive_file.code.output_base64sha256
252248

253249
runtime = "python3.7"
254250
timeout = 30

0 commit comments

Comments
 (0)