Skip to content

Commit

Permalink
update to tf .12
Browse files Browse the repository at this point in the history
  • Loading branch information
TJ Leonard committed Aug 20, 2019
1 parent 4d449b7 commit 5715298
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ 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}"
}

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}"
Expand Down Expand Up @@ -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
}
}

0 comments on commit 5715298

Please sign in to comment.