Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions infrastructure/modules/eventpub/archive_file_lambda.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
resource "archive_file" "lambda" {
type = "zip"
source_dir = "${path.module}/../../../lambda/eventpub/src"
data "archive_file" "lambda" {
type = "zip"
source_dir = "${path.module}/lambda/eventpub/src"
output_path = "${path.module}/lambda/${local.csi}_eventpub.zip"

# Timestamp in path to resolve https://github.com/hashicorp/terraform-provider-archive/issues/39
output_path = "${path.module}/../../../lambda/eventpub_${timestamp()}.zip"
excludes = [
# NodeJS Exclusions
"**/__tests__",
"**/node_modules",
"**/package.json",
"**/package-lock.json",
]

depends_on = [null_resource.force_archive]
}
4 changes: 2 additions & 2 deletions infrastructure/modules/eventpub/lambda_function.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ resource "aws_lambda_function" "main" {
memory_size = 128
timeout = 20

filename = archive_file.lambda.output_path
source_code_hash = archive_file.lambda.output_base64sha256
filename = data.archive_file.lambda.output_path
source_code_hash = data.archive_file.lambda.output_base64sha256

logging_config {
application_log_level = var.log_level
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resource "null_resource" "force_archive" {
triggers = {
always_run = timestamp()
}

provisioner "local-exec" {
command = "true"
}
}
Loading