Skip to content

Commit 193b0cf

Browse files
CCM-10257: Implement Eventpub in Core
1 parent 9c5d638 commit 193b0cf

4 files changed

Lines changed: 19 additions & 26 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
resource "archive_file" "lambda" {
2+
type = "zip"
3+
source_dir = "${path.module}/lambda/eventpub/src"
4+
5+
# Timestamp in path to resolve https://github.com/hashicorp/terraform-provider-archive/issues/39
6+
output_path = "${path.module}/lambda/eventpub_${timestamp()}.zip"
7+
excludes = [
8+
# NodeJS Exclusions
9+
"**/__tests__",
10+
"**/node_modules",
11+
"**/package.json",
12+
"**/package-lock.json",
13+
]
14+
lifecycle {
15+
create_before_destroy = true
16+
}
17+
}

infrastructure/modules/eventpub/lambda_function.tf

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ resource "aws_lambda_function" "main" {
99
memory_size = 128
1010
timeout = 20
1111

12-
filename = "${path.module}/lambda/eventpub/eventpub.zip"
13-
source_code_hash = base64encode(filesha256("${path.module}/lambda/eventpub/eventpub.zip"))
12+
filename = archive_file.lambda.output_path
13+
source_code_hash = archive_file.lambda.output_base64sha256
1414

1515
logging_config {
1616
application_log_level = var.log_level
@@ -27,6 +27,4 @@ resource "aws_lambda_function" "main" {
2727
THROTTLE_DELAY_MS = "0"
2828
}
2929
}
30-
31-
depends_on = [ "null_resource.lambda_zip" ]
3230
}

infrastructure/modules/eventpub/null_resource_lambda_test.tf

Lines changed: 0 additions & 10 deletions
This file was deleted.

infrastructure/modules/eventpub/null_resource_lambda_zip.tf

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)