From 5715298b4ab8fa63b157cdf4e42606c9e097f141 Mon Sep 17 00:00:00 2001 From: TJ Leonard Date: Tue, 20 Aug 2019 18:26:31 -0400 Subject: [PATCH] update to tf .12 --- lambda.tf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lambda.tf b/lambda.tf index c0366d9..7a8b199 100644 --- a/lambda.tf +++ b/lambda.tf @@ -11,7 +11,7 @@ data "archive_file" "dir_hash_zip" { } resource "null_resource" "install_python_dependencies" { - triggers { + triggers = { requirements = "${sha1(file("${var.source_code_path}/requirements.txt"))}" dir_hash = "${data.archive_file.dir_hash_zip.output_base64sha256}" } @@ -19,7 +19,7 @@ resource "null_resource" "install_python_dependencies" { provisioner "local-exec" { command = "bash ${path.module}/scripts/py_pkg.sh" - environment { + environment = { source_code_path = "${var.source_code_path}" path_cwd = "${path.cwd}" path_module = "${path.module}" @@ -48,5 +48,7 @@ resource "aws_lambda_function" "lambda" { timeout = "${var.timeout}" memory_size = "${var.memory_size}" - environment = ["${slice( list(var.environment), 0, length(var.environment) == 0 ? 0 : 1 )}"] + environment { + variables = var.environment + } }