Skip to content

Commit

Permalink
fix: TF dependency bugfix (#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
baolsen authored Feb 10, 2023
1 parent 34ff365 commit 351947d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 351947d

Please sign in to comment.