From 709043845064289a9048cac5a1363e614cfa1e70 Mon Sep 17 00:00:00 2001 From: overflowerror Date: Thu, 5 Aug 2021 13:41:29 +0200 Subject: [PATCH] fix: create_rules = false will not trigger error in output --- outputs.tf | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/outputs.tf b/outputs.tf index 29b526e..adeeb9c 100644 --- a/outputs.tf +++ b/outputs.tf @@ -24,16 +24,12 @@ output "eventbridge_permission_ids" { # EventBridge Rule output "eventbridge_rule_ids" { description = "The EventBridge Rule IDs created" - value = { - for p in sort(keys(var.rules)) : p => aws_cloudwatch_event_rule.this[p].id - } + value = var.create_rules ? { for p in sort(keys(var.rules)) : p => aws_cloudwatch_event_rule.this[p].id } : {} } output "eventbridge_rule_arns" { description = "The EventBridge Rule ARNs created" - value = { - for p in sort(keys(var.rules)) : p => aws_cloudwatch_event_rule.this[p].arn - } + value = var.create_rules ? { for p in sort(keys(var.rules)) : p => aws_cloudwatch_event_rule.this[p].arn } : {} } # IAM Role