File tree Expand file tree Collapse file tree
infrastructure/modules/eventpub Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- resource "archive_file" "lambda" {
2- type = " zip"
3- source_dir = " ${ path . module } /../../../lambda/eventpub/src"
1+ data "archive_file" "lambda" {
2+ type = " zip"
3+ source_dir = " ${ path . module } /lambda/eventpub/src"
4+ output_path = " ${ path . module } /lambda/${ local . csi } _eventpub.zip"
45
5- # Timestamp in path to resolve https://github.com/hashicorp/terraform-provider-archive/issues/39
6- output_path = " ${ path . module } /../../../lambda/eventpub_${ timestamp ()} .zip"
76 excludes = [
87 # NodeJS Exclusions
98 " **/__tests__" ,
109 " **/node_modules" ,
1110 " **/package.json" ,
1211 " **/package-lock.json" ,
1312 ]
13+
14+ depends_on = [null_resource. force_archive ]
1415}
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ resource "aws_lambda_function" "main" {
99 memory_size = 128
1010 timeout = 20
1111
12- filename = archive_file. lambda . output_path
13- source_code_hash = archive_file. lambda . output_base64sha256
12+ filename = data . archive_file . lambda . output_path
13+ source_code_hash = data . archive_file . lambda . output_base64sha256
1414
1515 logging_config {
1616 application_log_level = var. log_level
Original file line number Diff line number Diff line change 1+ resource "null_resource" "force_archive" {
2+ triggers = {
3+ always_run = timestamp ()
4+ }
5+
6+ provisioner "local-exec" {
7+ command = " true"
8+ }
9+ }
You can’t perform that action at this time.
0 commit comments