From bffd854fcbfc555d858b39dd8e7ef3fd0b9990f3 Mon Sep 17 00:00:00 2001 From: Gianmarco Fraccaroli <> Date: Wed, 12 Apr 2023 21:03:19 +0200 Subject: [PATCH] added source code hash --- main.tf | 2 +- variables.tf | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 06d2e79b..fc6a2d5c 100644 --- a/main.tf +++ b/main.tf @@ -52,7 +52,7 @@ resource "aws_lambda_function" "this" { } filename = local.filename - source_code_hash = var.ignore_source_code_hash ? null : (local.filename == null ? false : fileexists(local.filename)) && !local.was_missing ? filebase64sha256(local.filename) : null + source_code_hash = var.code_hash s3_bucket = local.s3_bucket s3_key = local.s3_key diff --git a/variables.tf b/variables.tf index 166f98da..4870c5ee 100644 --- a/variables.tf +++ b/variables.tf @@ -50,6 +50,11 @@ variable "lambda_at_edge" { default = false } +variable "code_hash" { + type = string + default = null +} + variable "function_name" { description = "A unique name for your Lambda Function" type = string