From cdcbb344f64919171f4cfb257a82affe66edc194 Mon Sep 17 00:00:00 2001 From: Ky Date: Wed, 26 Jun 2024 14:12:27 +0100 Subject: [PATCH 1/2] :bug:add condition to output as resource doesn't exist in live-2 --- outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/outputs.tf b/outputs.tf index 094f277..44f537e 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,4 +1,4 @@ output "s3_bucket_arn" { description = "s3 bucket arn" - value = aws_s3_bucket.flow_logs[0].arn + value = length(aws_s3_bucket.flow_logs) > 0 ? aws_s3_bucket.flow_logs[0].arn : null } \ No newline at end of file From e9c1b3338c10b99592187e683f3cad8a00e67c88 Mon Sep 17 00:00:00 2001 From: Ky Date: Wed, 26 Jun 2024 15:56:06 +0100 Subject: [PATCH 2/2] :wrench:add condition to output only if enabled --- outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/outputs.tf b/outputs.tf index 44f537e..954ba92 100644 --- a/outputs.tf +++ b/outputs.tf @@ -1,4 +1,4 @@ output "s3_bucket_arn" { description = "s3 bucket arn" - value = length(aws_s3_bucket.flow_logs) > 0 ? aws_s3_bucket.flow_logs[0].arn : null + value = var.is_enabled ? aws_s3_bucket.flow_logs[0].arn : null } \ No newline at end of file