From 351947d0b1a3b05842fa65f122d73d633fb716d1 Mon Sep 17 00:00:00 2001 From: Bjorn Olsen Date: Fri, 10 Feb 2023 11:44:17 +0200 Subject: [PATCH] fix: TF dependency bugfix (#42) --- main.tf | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/main.tf b/main.tf index 4b25f43..2f8c3fa 100644 --- a/main.tf +++ b/main.tf @@ -33,15 +33,11 @@ locals { deployment_filename = "costnotifier-${var.runtime}.zip" deployment_path = "${path.module}/${local.deployment_filename}" - use_s3 = ( - var.upload_deployment_to_s3 && var.s3_bucket != null - ) - s3_key = coalesce(var.s3_key, join("/", [var.naming_prefix, local.deployment_filename])) } resource "aws_s3_object" "deployment" { - count = local.use_s3 && var.upload_deployment_to_s3 ? 1 : 0 + count = var.upload_deployment_to_s3 && (var.s3_bucket != null) ? 1 : 0 bucket = var.s3_bucket key = local.s3_key source = local.deployment_path @@ -65,7 +61,7 @@ module "billing_notifier_lambda" { local_existing_package = local.deployment_path s3_existing_package = ( - local.use_s3 + var.s3_bucket != null ? { bucket = var.s3_bucket key = local.s3_key