diff --git a/iam.tf b/iam.tf index 8e399ae..4afc3b6 100644 --- a/iam.tf +++ b/iam.tf @@ -329,6 +329,7 @@ resource "aws_iam_policy" "additional_json" { count = local.create_role && var.attach_policy_json ? 1 : 0 name = local.role_name + path = var.role_path policy = var.policy_json } diff --git a/outputs.tf b/outputs.tf index ef9abea..1a5e6b4 100644 --- a/outputs.tf +++ b/outputs.tf @@ -41,12 +41,12 @@ output "eventbridge_api_destination_arns" { # EventBridge Rule output "eventbridge_rule_ids" { description = "The EventBridge Rule IDs created" - value = { for k in sort(keys(var.rules)) : k => aws_cloudwatch_event_rule.this[k].id if var.create && var.create_rules } + value = { for k in sort(keys(var.rules)) : k => try(aws_cloudwatch_event_rule.this[k].id, null) if var.create && var.create_rules } } output "eventbridge_rule_arns" { description = "The EventBridge Rule ARNs created" - value = { for k in sort(keys(var.rules)) : k => aws_cloudwatch_event_rule.this[k].arn if var.create && var.create_rules } + value = { for k in sort(keys(var.rules)) : k => try(aws_cloudwatch_event_rule.this[k].arn, null) if var.create && var.create_rules } } # IAM Role