diff --git a/main.tf b/main.tf index 59cc6a0..3335f22 100644 --- a/main.tf +++ b/main.tf @@ -59,6 +59,7 @@ resource "aws_lambda_function" "main_s3" { timeout = "${var.timeout}" role = "${aws_iam_role.main.arn}" reserved_concurrent_executions = "${var.reserved_concurrent_executions}" + source_code_hash = "${var.source_code_hash}" environment { variables = "${var.environment}" @@ -85,6 +86,7 @@ resource "aws_lambda_function" "vpc_s3" { timeout = "${var.timeout}" role = "${aws_iam_role.main.arn}" reserved_concurrent_executions = "${var.reserved_concurrent_executions}" + source_code_hash = "${var.source_code_hash}" vpc_config { subnet_ids = ["${var.subnet_ids}"] diff --git a/variables.tf b/variables.tf index 39a6ad4..af3ebc8 100644 --- a/variables.tf +++ b/variables.tf @@ -89,3 +89,8 @@ variable "reserved_concurrent_executions" { description = "The amount of reserved concurrent executions for this lambda function. A value of 0 disables lambda from being triggered and -1 removes any concurrency limitations. Defaults to Unreserved Concurrency Limits -1" default = -1 } + +variable "source_code_hash" { + description = "Used to trigger updates. Must be set to a base64-encoded SHA256 hash of the package file specified with either filename or s3_key." + default = "" +}