fix: create_rules = false will not trigger error in output

This commit is contained in:
overflowerror 2021-08-05 13:41:29 +02:00
parent 906db9f7dc
commit 7090438450

View file

@ -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