From c1f836796d840b447770c698795bf62646d7a15a Mon Sep 17 00:00:00 2001 From: Ruben Santos Date: Mon, 29 Jan 2024 14:10:58 -0300 Subject: [PATCH 1/5] Use data_archive.output_path instead of path_module --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index d990d18..c835ab5 100644 --- a/main.tf +++ b/main.tf @@ -89,7 +89,7 @@ data "archive_file" "notifier_package" { } resource "aws_lambda_function" "pipeline_notification" { - filename = "${path.module}/lambdas/notifier.zip" + filename = data.archive_file.notifier_package.output_path function_name = module.this.id role = aws_iam_role.pipeline_notification.arn runtime = "python3.8" From 52c2b48f5a88aef5ac8468ca8c60bd7720882779 Mon Sep 17 00:00:00 2001 From: Ruben Santos Date: Mon, 29 Jan 2024 16:17:06 -0300 Subject: [PATCH 2/5] Add archive_file.output_file_mode to avoid drift state in different OS --- main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/main.tf b/main.tf index c835ab5..07e7739 100644 --- a/main.tf +++ b/main.tf @@ -85,6 +85,7 @@ data "aws_iam_policy_document" "pipeline_updates_policy" { data "archive_file" "notifier_package" { type = "zip" source_file = "${path.module}/lambdas/notifier/notifier.py" + output_file_mode = "0666" output_path = "${path.module}/lambdas/notifier.zip" } From a6125ce7857c000d9d10bcfe5023c1812ae3f69d Mon Sep 17 00:00:00 2001 From: Ruben Santos Date: Tue, 30 Jan 2024 21:35:59 -0300 Subject: [PATCH 3/5] Moving file mode 0777 --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 07e7739..0c9de64 100644 --- a/main.tf +++ b/main.tf @@ -85,7 +85,7 @@ data "aws_iam_policy_document" "pipeline_updates_policy" { data "archive_file" "notifier_package" { type = "zip" source_file = "${path.module}/lambdas/notifier/notifier.py" - output_file_mode = "0666" + output_file_mode = "0777" output_path = "${path.module}/lambdas/notifier.zip" } From 39cd42d0bc0176350834395109e41d05ff10c785 Mon Sep 17 00:00:00 2001 From: Ruben Santos Date: Tue, 30 Jan 2024 22:00:11 -0300 Subject: [PATCH 4/5] Rollback file mode to 0666 --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 0c9de64..07e7739 100644 --- a/main.tf +++ b/main.tf @@ -85,7 +85,7 @@ data "aws_iam_policy_document" "pipeline_updates_policy" { data "archive_file" "notifier_package" { type = "zip" source_file = "${path.module}/lambdas/notifier/notifier.py" - output_file_mode = "0777" + output_file_mode = "0666" output_path = "${path.module}/lambdas/notifier.zip" } From 58912a625c029e797a857ad0588aa47a97933d6c Mon Sep 17 00:00:00 2001 From: Ruben Santos Date: Fri, 2 Feb 2024 11:37:14 -0300 Subject: [PATCH 5/5] Fix format --- main.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.tf b/main.tf index 07e7739..a092bcc 100644 --- a/main.tf +++ b/main.tf @@ -83,10 +83,10 @@ data "aws_iam_policy_document" "pipeline_updates_policy" { } data "archive_file" "notifier_package" { - type = "zip" - source_file = "${path.module}/lambdas/notifier/notifier.py" + type = "zip" + source_file = "${path.module}/lambdas/notifier/notifier.py" output_file_mode = "0666" - output_path = "${path.module}/lambdas/notifier.zip" + output_path = "${path.module}/lambdas/notifier.zip" } resource "aws_lambda_function" "pipeline_notification" {