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